[wxPython-users] Re: Trouble with drawing, I need some ideas
:)
Robin Dunn
robin at alldunn.com
Mon Oct 1 13:02:35 PDT 2007
Peter Damoc wrote:
> Hi Robin,
> First, let me apologize for not being clear again. :)
>
> I appreciate the advice you gave BUT it is not touching the real issue.
> The sample created was just some boiler plate for people to play with.
> It was not "efficient".
> I can do all the buffering that could be done BUT my main issue remains
> the same:
>
> How do I use alpha in a buffer that need to be blited over some other
> drawing? Color based transparency won't do because of the wxGCDC used in
> the buffer.
>
> Here... take a look at this kind of desperate code:
>
> cache = wx.MemoryDC(wx.EmptyBitmap(w,h))
> cache.SetBackground(wx.TRANSPARENT_BRUSH)
> cache.SetBackgroundMode(wx.TRANSPARENT )
> cache.Clear()
> gc_cache = wx.GCDC(cache)
> gc_cache.SetBackground(wx.TRANSPARENT_BRUSH)
> gc_cache.SetBackgroundMode(wx.TRANSPARENT)
> gc_cache.Clear()
>
> Maybe it expresses what I'm trying to accomplish.
I see you found a solution, but to help clarify this for you let me
point out that using a transparent brush simply means "don't draw
anything", not "change these pixels to transparent".
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wxpython-users
mailing list