How to copy a bitmap from underneith a wxWindow?

I am trying to create bitmap buttons that show transparent images correctly. I stumbled upon this thread from a while ago
http://aspn.activestate.com/ASPN/Mail/Message/wxPython-users/1440054
and it seems like a good approach (basically draw whatever is under my
bitmap button onto it as a background… ie fake transparency).

The problem I am having is getting “the picture” (a bitmap basically)
of whatever is under my bitmap button. I think the issue is that the
wxWindow for my bitmap button is already drawn on top of the parent and
that’s why I can’t get to those pixels anymore. Is there any solution
to that?

Thanks much!
Ratko

Ratko Jagodic wrote:

I am trying to create bitmap buttons that show transparent images correctly. I stumbled upon this thread from a while ago
http://aspn.activestate.com/ASPN/Mail/Message/wxPython-users/1440054
and it seems like a good approach (basically draw whatever is under my bitmap button onto it as a background... ie fake transparency).

The problem I am having is getting "the picture" (a bitmap basically) of whatever is under my bitmap button. I think the issue is that the wxWindow for my bitmap button is already drawn on top of the parent and that's why I can't get to those pixels anymore. Is there any solution to that?

I don't know how well it would work but you can try to do it by hiding your window, wait for the parent's paint event to happen, and then grab the bitmap and show your window again.

···

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