Quantcast

wxPoint and Bitmap pixel color value

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

wxPoint and Bitmap pixel color value

ravpreet bhamra
Hi
I am new to python and wxPython. I am trying to make an application that has to do operations on a bit map. How can i get the color value of a pixel on a bitmap when i click on the bitmap. Is there any function that can help me do that.
 
thanks
ravi



---------------------------------
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: wxPoint and Bitmap pixel color value

Robin Dunn
ravpreet bhamra wrote:
> Hi
> I am new to python and wxPython. I am trying to make an application that has to do operations on a bit map. How can i get the color value of a pixel on a bitmap when i click on the bitmap. Is there any function that can help me do that.

You can put the bitmap into a wxMemoryDC and then use dc.GetPixel, or
you can convert the bitmap to a wxImage and use image.GetRed,
image.GetGreen, image,GetBlue.

--
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!




Loading...