Getting Pixel Value

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Raju

    #1

    Getting Pixel Value

    Is there any way to get and set the pixel value in a
    container control(form, picturebox...)?
  • Fred Mellender

    #2
    Re: Getting Pixel Value

    PictureBox has an Image object that you can get/set. Until you set the
    Image there are no Pixels in the PictureBox. To set the image, you must
    have created an Image object from something.

    Image is an abstract class, so you must have created it from a subclass
    object (e.g. a BitMap) and that object would give you access to the Pixels.

    Given just an object of type PictureBox, or one of type Image, I don't see
    any way to get the Pixels. You need to save the object from which you
    created the Image (which you put in the PictureBox) to recover the Pixels.

    If you have a windows handle you can get a bitmap via FromHbitmap from the
    Image in the PictureBox. But that is a static method in Image and has no
    real relation to the PictureBox that contains the Image.

    That's my understanding but I could be wrong.


    "Raju" <anonymous@disc ussions.microso ft.com> wrote in message
    news:021d01c3a6 bf$24596ab0$a00 1280a@phx.gbl.. .[color=blue]
    > Is there any way to get and set the pixel value in a
    > container control(form, picturebox...)?[/color]


    Comment

    Working...