Option ExplicitPrivate Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal y As Long) As LongPrivate Const CF_BITMAP = 2Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As LongDim phobit (0 to 9, 0 to 9) As Integer 'pixel Private Sub cmdGetChar_Click identification bitmap () Dim X As LongDim i As IntegerDim J AS INTEGERDIM K AS INTEGERDIM MINTCURPOS AS INTEGERWIM MINTCURPOS AS INTEGERWIM MINTCURPOS AS INTEGERWITH PICTURE2 for K = 0 to 3 'indicates four characters, for i = 0 to 9 mintCurpos = INSTR (TXTPHOBIT.TEXT, "Digital" & I & ":") 4' Current location for digital characters for J = 0 to 9 x = getpixel (.hdc, k * 10, j) 'get its pixel value IF (x = 15658734 and mid (txtphobit.text, mintcurpos j, 1) = " 0 ") _ or (x <> 15658734 and mid (txtphobit.text, mintCurpos j, 1) =" 1 ") The 'is determined whether the pixel is the same. Else 'Different EXIT for end if next jiff j = 10 Then' can judge that the current character is I txtphochar.text = txtphochar.text & i exit for end if next i next kend Withend Sub
Private Sub Form_Load () txtPhoBit.Text = "0 numbers: number 1 0111111110: 0100000001 number 2: 3 number 0100000011: 0100000010 numbers 4: 0000011000 numbers 5: 6 numbers 1111100010: 0011111110 numbers 7: 1100000000 numbers 8: 0111011110 numbers 9: 0111100000 "IF not urldownloadtofile (0," http://bbs.china95.net/dv_getcode.asp ", app.path &" /pho.bmp ", 0, 0) Then Picture2.Picture = loadingPicture (app.path &" /pho.bmp ") Else Msgbox" Save Image Error! "End if End Sub I analyzed your picture, found that all RGB (238, 238, 238) is 15658734 in an empty place, and its digital arrangement is very Tectonic, that is, the same number there is the same number of pixel maps. And each number is ten pixels. I am planning to compare all of each of them, that is, every number is 10 * 10 times. I always feel this waste of time, and then I also found that as long as the first word of each number can get the numbers you want. So starting 10 numbers in txtphobit, if the pixel value is 15658734, then it is set to "0", not equal to 15658734, set to "1"
This method is only valid for this picture (100% accuracy), just like chinaren, it is useless.