SickelSell
10-24-2006, 09:44 PM
This is my getpixel function, I changed the Longs to Integers.
Declare Function GetPixel Lib "gdi32" (ByVal hdc As Integer, ByVal x As Integer, _
ByVal y As Integer) As Integer
Dim y, x As Integer
Dim offby As Integer
offBy = 350
Do
For y = 10 To ocrpic.Height - 15 Step 4
For x = 10 To ocrpic.Width - 15 Step 4
Dim hdc = ocrpic.CreateGraphics.GetHdc
If ColourDiff(GetPixel(hdc, x, y), Color.Black) < offby Then
MsgBox(x)
Exit Do
End If
ocrpic.CreateGraphics.ReleaseHdc()
Next x
Next y
offBy = offBy + 50
Loop
I get the error
Value of type 'Integer' cannot be converted to 'System.Drawing.Color'.
On
[/PHP]GetPixel(hdc, x, y)[/PHP]
Can you help, Please?
Declare Function GetPixel Lib "gdi32" (ByVal hdc As Integer, ByVal x As Integer, _
ByVal y As Integer) As Integer
Dim y, x As Integer
Dim offby As Integer
offBy = 350
Do
For y = 10 To ocrpic.Height - 15 Step 4
For x = 10 To ocrpic.Width - 15 Step 4
Dim hdc = ocrpic.CreateGraphics.GetHdc
If ColourDiff(GetPixel(hdc, x, y), Color.Black) < offby Then
MsgBox(x)
Exit Do
End If
ocrpic.CreateGraphics.ReleaseHdc()
Next x
Next y
offBy = offBy + 50
Loop
I get the error
Value of type 'Integer' cannot be converted to 'System.Drawing.Color'.
On
[/PHP]GetPixel(hdc, x, y)[/PHP]
Can you help, Please?