Hi guys
I wanted to see, How can I get Each pixel’s color In a picturebox The main Purpese I’m doing this is that I want to find out which pixels’ of my image file are More darker than the others.
Can any body help?
Thank u very much
Printable View
Hi guys
I wanted to see, How can I get Each pixel’s color In a picturebox The main Purpese I’m doing this is that I want to find out which pixels’ of my image file are More darker than the others.
Can any body help?
Thank u very much
In a PictureBox, use the Point method: http://msdn.microsoft.com/library/en...asp?frame=true
Use "Pixel" and "Point" to set and get the pixel on a picturebox.
but it seems that it gives me the color of each point in a smaller unit than pixel(maybe twips) how can i take the pixels' color?
hellllllllllooo
can't anyone answer?
Set the scalemode of the picturebox to 3, and use the GetPixel API call
try this code
Code:Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, _
ByVal y As Long) As Long
Dim pixelColor As Long
pixelColor = GetPixel(Picture1.hdc, x, y)
I guess that if I set scalemode to pixel then no more API call will be needed if the point method would work for pixels after that. don't u think so? or the api call works faster?
FYI, pixel is the smallest unit that is displayed on the screen.
no pixel is 12*12 twips
"Virtually" perhaps. But physically the smallest definable/displayable unit on the screen is a pixel
yeah maybe on the monitor screen it's so. but when working with printer u can difine and use twip coz some printers r more accuret than monitors
*cough* 2 nil *cough*
*mutter* pansy goalie *mutter*
;)
mrdj1002 even for the printer, Pixel - is the smallest unit:
Also, twips are screen independent measurements.
Check out ScaleMode Property for a reference.
thanks serg. but u should complain the auther of the book i read this thing in it. and hey plendreg i didn't understand what u said. BTW it seems that u hammerd us in dublin but hey watch out your guys in tehran ;)
Ypur goalkeeper was ... for want of a better word ... a pansy.
He was useless and kept pretending he was hurt. He should have been given a red card !