How to make AnimationCtrl transparent on MS Windows

Hello:
I try to use AnimationCtrl to display GIF in current project, I write
and test on Ubuntu 7.10, everything seems OK.
Because my users work with MS Windows, so I test it on Windows XP, here
is problem.
AnimationCtrl looks ugly on Windows, with a background color, but I
don't want it. I want it works exactly as on Ubuntu. So anyone can help
me to solve this problem? Thanks
the attachments are screen-snap images showing AnimationCtrl's different
display on Ubuntu & Windows.

linux.png

windows.png

On wxGTK the wxAnimationCtrl is implemented using a native GTK widget, that just happens to draw itself directly on the parent window instead of having it's own window. On Windows (and Mac) a generic control is used that does have its own window, and hence has a background, and is subject to all the other limitations and benefits of being a real platform window object. So in effect, you are relying on something that is an "implementation detail" on wxGTK that is not necessarily part of the intended feature set of the class.

You can do what you want however by drawing the animation frames on the parent window yourself instead of using a separate control. Load your image into a wx.animate.Animation object, and then you can use the methods of that object to get the number of frames in the animation, get each frame as an image, and get the delay between frames. Then use a timer with those delays to help you draw each frame of the animation at the right time.

···

lovely.python@gmail.com wrote:

Hello:
I try to use AnimationCtrl to display GIF in current project, I write
and test on Ubuntu 7.10, everything seems OK.
Because my users work with MS Windows, so I test it on Windows XP, here
is problem.
AnimationCtrl looks ugly on Windows, with a background color, but I
don't want it. I want it works exactly as on Ubuntu. So anyone can help
me to solve this problem? Thanks
the attachments are screen-snap images showing AnimationCtrl's different
display on Ubuntu & Windows.

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

Hi Robin:
  Attachments are GIF files I test using wx.animate.Animation and timer,
but some frames don't show a complete image, only a change part
compared with previous frame.

That is expected. You'll need to be sure to draw each frame (except maybe the first) with transparency enabled.

BTW: I called wx.animate.Animation.GetFrameCount on Ubuntu 7.10, but
always get wrong result, it's OK on Windows.

You can enter a bug report about this, using a category of "wxGTK Specific"

···

lovely.python@gmail.com wrote:

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