Need Some Help With This Code

Posts 1–2 of 2 · Page 1 of 1
Need Some Help With This Code
I would need some help with this code its a pixel recognition source code in vb but I can't get it to work
I know there is a picture box called pic and a text box called rtb

heres the code if anyone could help it would be nice or point me to a better one

Code:
Dim sz(9) As String
        sz(0) = "0000110000001111000011001100110000110110000110110000110110000110011001100001
11100"
        sz(1) = "0000110000000110000001110000011110000000110000000110000000110000000110000000
11000000011000001111110"
        sz(2) = "0001111000011001100110000110000000110000001100000011000000110000001100000011
00000011111111"
        sz(3) = "0011111000110001100000000110000001100000111000000001100000000110000000110110
00110001111100"
        sz(4) = "0000001100000011100000111100001101100011001100110001100111111110000001100000
00110000000110"
        sz(5) = "0111111100110000000110000000110111000111001100000000110000000110110000110011
00110000111100"
        sz(6) = "0001111000011001100110000100110000000110111000111001100110000110110000110011
00110000111100"
        sz(7) = "0111111110000000110000000110000001100000011000000110000001100000011000000110
00000011000000"
        sz(8) = "0001111000011001100110000110011001100001111000011001100110000110110000110011
00110000111100"
        sz(9) = "0001111000011001100110000110110000110011001110001110110000000110010000110011
00110000111100"

        Dim x As Integer = 0
        Dim y As Integer = 0
        Dim nLine As Integer = 0
        Dim nGroup As Integer = 0
        Dim szGroup(5) As String
        Dim szTemp As String = ""
        Dim bmp As Bitmap = pic.Image.Clone
        For y = 11 To pic.Height - 10 Step 1
            nLine = 1
            nGroup = 0
            For x = 7 To pic.Width - 9 Step 1
                If bmp.GetPixel(x, y).ToArgb = Color.White.ToArgb Then
                    szTemp = szTemp & "0"
                ElseIf bmp.GetPixel(x, y).ToArgb = Color.Black.ToArgb Then
                    szTemp = szTemp & "1"
                End If
                If nLine = 9 Then

                    szGroup(nGroup) = szGroup(nGroup) & szTemp
                    szTemp = ""
                    nLine = 1
                    nGroup += 1
                Else
                    nLine += 1
                End If
            Next
        Next
        For x = 0 To 5
            For y = 0 To 9
                If szGroup(x) = sz(y) Then
                    rtb.Text = rtb.Text & y.ToString
                End If
            Next
        Next
Please learn the basics. You are heading to be a copy paster if we continue to help you. I am closing this. Start with the basics and if you are having trouble with that, I'll gladly help you.

Closed.
Posts 1–2 of 2 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us