[wxruby-users] Black background using paint_buffered
Mario Steele
mario at ruby-im.net
Wed Apr 23 06:45:05 EDT 2008
Dang you Alex,
You beat me to it. :P Actually, another suggestion, would be to use
Wx::DC#draw_rectangle(), in which you set the Pen and Brush with the color
you want to use.
Simple Example (Not Tested):
<code>
pen = Wx::Pen.new(Wx::WHITE)
brush = Wx::Brush.new()
brush.colour(Wx::WHITE)
dc.set_pen(pen)
dc.set_brush(brush)
dc.draw_rectangle(0,0,self.width,self.height)
.... do your drawing here ....
</code>
L8ers,
On Wed, Apr 23, 2008 at 5:34 AM, Alex Fenton <alex at pressure.to> wrote:
> Andreas Warberg wrote:
> > To avoid flickering during screen updates in a Frame on Windows I
> > recently switched from
> >
> > paint do | dc |
> > #...
> > end
> >
> > to
> >
> > paint_buffered do | dc |
> > #...
> > end
> >
> > The background colour of the Frame is set to WHITE, which is respected
> > under paint, but is replaced by BLACK under paint_buffered.
> >
> > The painting jobs seems fine, though all my black lines become invisible
> > :P
> >
> > Is there something I can do to sort this out? Perhaps supply my own
> > buffer...
> >
> Yes, you can pass your own buffer as an optional argument to
> paint_buffered. It should be a Wx::Bitmap of the appropriate height and
> width.
>
> I will see if the ruby code that does paint_buffered could make the
> bitmap background match the window's.
>
> a
>
> _______________________________________________
> wxruby-users mailing list
> wxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wxruby-users
>
--
Mario Steele
http://www.trilake.net
http://www.ruby-im.net
http://rubyforge.org/projects/wxruby/
http://rubyforge.org/projects/wxride/
http://rubyforge.org/projects/vwmc/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080423/473e4348/attachment.html
More information about the wxruby-users
mailing list