[wxPython-users] getting background color behind about an area?

Phil Mayes phil at philmayes.com
Thu Nov 2 15:55:48 PST 2006


At 03:44 PM 11/2/2006, you wrote:
>hello everyone!
>
>How do you go about getting the color currently about an area?
>
>For example, if i want to draw a rectangle, but want to know what the
>color is before drawing it, can i know the color before i draw the
>rectangle?
>
>Any help would be much appreciated!
>--


If you mean "what color would it be drawn in", the answer is the current brush
selected into the device context (wx.DC).  But if you mean "what is the 
color that the rectangle will over-write", use dc.GetPixel() or (I think) 
wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW)

Phil






More information about the wxpython-users mailing list