seems a very simple question,
but I can't find the right information,
and interactive mode gives me problems with wx.
I need to extract the RGB colors form a Brush,
change the color and put them back in the brush.
How is that done ?
thanks,
Stef Mientki
Hi Stef,
seems a very simple question,
but I can't find the right information,
and interactive mode gives me problems with wx.
I need to extract the RGB colors form a Brush,
change the color and put them back in the brush.
How is that done ?
I would so something like:
oldBrushColour = brush.GetColour()
newBrushColour = self.ManipulateBrushColour(oldBrushColour)
brush.SetColour(newBrushColour)
# Continue painting...
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
···
On 6/14/07, Stef Mientki wrote:
Robin
June 14, 2007, 8:17pm
3
Andrea Gavana wrote:
Hi Stef,
seems a very simple question,
but I can't find the right information,
and interactive mode gives me problems with wx.
I need to extract the RGB colors form a Brush,
change the color and put them back in the brush.
How is that done ?
I would so something like:
oldBrushColour = brush.GetColour()
newBrushColour = self.ManipulateBrushColour(oldBrushColour)
brush.SetColour(newBrushColour)
# Continue painting...
You also need to do
dc.SetBrush(brush)
again to create a new native brush with the new color and to give that to the DC.
···
On 6/14/07, Stef Mientki wrote:
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
Robin Dunn wrote:
Andrea Gavana wrote:
Hi Stef,
seems a very simple question,
but I can't find the right information,
and interactive mode gives me problems with wx.
I need to extract the RGB colors form a Brush,
change the color and put them back in the brush.
How is that done ?
I would so something like:
oldBrushColour = brush.GetColour()
newBrushColour = self.ManipulateBrushColour(oldBrushColour)
brush.SetColour(newBrushColour)
# Continue painting...
You also need to do
dc.SetBrush(brush)
again to create a new native brush with the new color and to give that to the DC.
thanks Andrea and Robin,
indeed I needed to create a new brush, and I now do it like this:
self.Color_On = wx.Brush(Color)
self.Color_Off = wx.Brush(( Color.Red()//2, Color.Green()//2,Color.Blue()//2))
although there's a lot of data on wxpython.org,
this kind of information is very hard to find.
Some of these pages contains just too much data (not information),
isn't it possible to reduce the data with epydoc ?
cheers,
Stef Mientki
···
On 6/14/07, Stef Mientki wrote: