Pixel Color

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to know if there is a way to click on an image and be able to
get the color of the pixel that the stylus is touching? (ie. if the stylus is
touching red then I would like to be able to return that it is touching red)


nb
 
You can do it for anywhere on the screen with a bit of P/Invoke. Use GetDC
passing in IntPtr.Zero for the context for the entire screen. Then use
GetPixel to retrieve the rgb value of any pixel. Remember also to ReleaseDC
when you've finished.

Peter
 
Back
Top