The errors must be because the post doesn't come out right.
What looks like this:
&H10000 is actually hex for the value 65536
and &H100 is hex for 256
You can use the loop denniswrenn wrote but substitute vbBlack for GetGrayScale(TColor)
You have to declare SetPixel and GetPixel.Code:Call SetPixel(Picture1.hdc, i, j, GetGrayScale(TColor))
Good luck!Code:Public Declare Function GetPixel _ Lib "gdi32" Alias "GetPixel" ( _ ByVal hdc As Long, _ ByVal x As Long, _ ByVal y As Long) As Long Public Declare Function SetPixel _ Lib "gdi32" Alias "SetPixel" ( _ ByVal hdc As Long, _ ByVal x As Long, _ ByVal y As Long, _ ByVal crColor As Long) As Long




Reply With Quote