Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Color of Pixel

Status
Not open for further replies.

aztined

Programmer
Nov 18, 2003
5
BG
How can I get the value of color of pixel of Image that is covered by other Image?
 
GetPixel isn't enough in this situation, as

a) Images don't have a Device Context
b) Even if you put the Image into a Picturebox instead, GetPixel gets affected by VB's clipping (exactly as does VB's Point command, which is just a wrapper for GetPixel) - pixels that are hidden from display return CLR_INVALID

One solution to this is to pop the picture into a screen-compatible memory DC with no clip region, and call GetPixel against that. I produced a worked example of this in thread222-263560
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top