none
In System.Drawing class, how to report pixel value RRS feed

  • Question

  • Hello

      Suppose I have a canvas with some filled-color objects (rectangles, ellipses). How do I get values of pixels or areas of the drawing canvas so that scanning through all these areas can generate responses and report back area locations of changes in these values? There are numerous classes that seem to have these features but they may not work with the System.Drawing class, I'm not sure about this.

    Thanks, JJS

     

    Thursday, February 15, 2018 10:13 PM

Answers

  • Hello,

     It not easy to get a single pixel color value. You must capture the Region of the Form/Screen

    into a Bitmap and then use the method Bitmap.GetPixel( x, y )  Because Windows Desktop

    Manager does not allow direct access. Read the information at the following link;

     https://msdn.microsoft.com/en-us/library/system.drawing.bitmap.getpixel(v=vs.110).aspx

     

     Hope this helps :)

    Thursday, February 15, 2018 11:42 PM