Aight well I figured that the simplest way of getting the text would be to directly check bit for bit if its the same letter. What I got so far is I am trying to seperate each letter from an image. Then I go letter to letter line to line searching for the letter. Heres what i got

private void button2_Click(object sender, EventArgs e)
        {
            int[,] ImageArray = new int [13,13];
            int index = 0;
            bool First = false;

            Form1 Method = new Form1();
            StreamWriter SW = File.CreateText("Array.txt"); ;
            

            Method.InitializeArray(ImageArray);

            this.Hide();
            bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
            gfxScreenshot = Graphics.FromImage(bmpScreenshot);
            gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
            this.Show();

            for (int x = 158; x <= 684; x++)
            {
                for (int i = 710; i <= 826; i++)
                {
                    CutImage.SetPixel(x - 158, i - 710, bmpScreenshot.GetPixel(x, i));
                }
            }

            for (int x = 0; x < 527; x++)
            {
                for (int y = 0; y < 13; y++)
                {
                    if (CutImage.GetPixel(x, y) == CutImage.GetPixel(2, 3))
                    {
                        goto copy;
                    }
                }
                goto newletter;

            copy:
                for (int y = 0; y < 13; y++)
                {
                    if (CutImage.GetPixel(x, y) == CutImage.GetPixel(1, 2) && index<13)
                        ImageArray[index, y] = 1;
                }
                index++;
                continue;

            newletter:
                if (First == false)
                {
                    for(int y=0; y < 13; y++)
                    {
                        for(int a = 0; a < 13; a++)
                        {
                            SW.Write(ImageArray[a, y]);
                        }
                        SW.WriteLine();

                    }
                    First = true;
                }
                Method.InitializeArray(ImageArray);
                index = 0;
            }
            SW.Close();
        }

Im just trying to get the first letter as a test. Where InitializeArray just sets the array to 0. I am getting output into my txt file but heres my problem. I am trying to get each individual letter however, some of the letters are being cut into the array. Heres an example:

000000000
011110000
010000001
010000010
011110111
010000100
011110011
000000000

Where the 1s indicate the pixel of interest. Please help/if you know a better way/faster way of this then by all means... Otherwise Ive been staring off into space on this one. OO and one more thing what tags should I place around my code so its c# i used cplusplus but i dont even know if thats right lol.
Thanks in advance guys.

heres another way:
librarys you'll need: using System.Text.RegularExpresions;

code block:

Regex r = new Regex("As:(.*);");
string s = (richTextBox1.Text); /*note richTextBox or TextBox*/
MatchCollection mc = r.Matches(s);
MessageBox.Show(mc[0].Groups[1].Value);

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.