Hi
I am currently having problems on how to loop inside a picture which is being captured by a webcam.
it is already "bitmap" in form when i copied to from the clipboard to the picturebox?
i already figured out how to capture images from my webcam, but my problem now is to get the color inside the image being captured (the image is inside a picturebox)
i tried hard figuring this out. i have found alot of codes like: color under mouse, and color picker. but are they related to what i am making now?
sorry for my bad english.
I hope you guys can help me with this.
Here is my code:
List1.Clear
px = Picture4.Width / Screen.TwipsPerPixelX / 2
py = Picture4.Height / Screen.TwipsPerPixelY / 2
For i = 1 To Picture4.Width / Screen.TwipsPerPixelX Step 3
For j = 1 To Picture4.Height / Screen.TwipsPerPixelY Step 3
'Convert to RGB
'Picture4.Circle (px * Screen.TwipsPerPixelX, py * Screen.TwipsPerPixelY), 10, RGB(255, 0, 0)
r = (GetPixel(Picture4.hdc, i, j) Mod 256)
b = Int(GetPixel(Picture4.hdc, i, j) / 65536)
g = (GetPixel(Picture4.hdc, i, j) - (b * 65536) - r) / 256
List1.AddItem "RGB=" & r & " " & g & " " & b
Next
Next
End Sub
is this the right way to get the image's color in rgb???




hehehe
Reply With Quote
