PDA

Click to See Complete Forum and Search --> : determine pixel color , not GetPixel !!


wengang
Mar 1st, 2002, 01:17 PM
Hi.
I have a form with several objects moving around by timer.

when the objects have finished moving I want to know the color of the pixel at the 0,0 point of a certain picture box.

BUT, the reason I can't use GetPixel is:
I don't want it to necessarily return the color value in Picture1.
I only want that value to be returned if nothing is in front of Picture1. If another object is in front of picture1 at point 0,0 , want that color to be returned. So, in graphic terms, that means whatever color the user sees at that point on the screen, is the color info I want to collect.

Any thoughts?
Thanks
Wengang

Janus
Mar 1st, 2002, 01:49 PM
You'd have to check for overlapping controls manually.

wengang
Mar 1st, 2002, 06:19 PM
well, that's what I'm trying to avoid for speed's sake


There is no way to just get a pixel color at a certain screen point regardless of what control occupies it?


The color picker in several programs can draw from any area of the screen, even other windows, though

Helger
Mar 4th, 2002, 07:13 AM
You can bitblit a small part of the picturebox to a new picturebox.
then use getpixel on the new picturebox. Bitblit works fast I think and will only capture the frontmost stuff.

zai hui,

Helger

kedaman
Mar 4th, 2002, 07:43 AM
getdc your window and getpixel with coordinates client to it