I want to make a control that works with PNGs but looks like the wxAnimation (same exposed functions, so i can replace it with mine); so basically the animation is a single long PNG "strip" of frames, and the control show a portion of it as a "frame".
What should be the best approach? Should i start for the wxAnimation sources and change them to build my own, or should writing everything from scratch? Deriving from a wxImage, a wxPanel, a wxBitmap?
What would you suggest?
Making a PNG animation control: what's the best approach?
-
- I live to help wx-kind
- Posts: 193
- Joined: Fri Jan 30, 2015 1:48 pm
- Location: Bologna, Italy
-
- Part Of The Furniture
- Posts: 4204
- Joined: Sun Jan 03, 2010 5:45 pm
Re: Making a PNG animation control: what's the best approach?
I have just took a cursory look at wxAnimationCtrl API. Wouldn't it be possible to derive a wxAnimation class and use wxAnimationCtrl::SetAnimation()? wxAnimation expects only a single string for a file name but that could be worked around...
EDIT
It seems the above may unfortunately be impossible, as wxAnimationCtrl takes a reference (and not a pointer) to wxAnimation, so the derived wxAnimation gets sliced to wxAnimation.
EDIT
It seems the above may unfortunately be impossible, as wxAnimationCtrl takes a reference (and not a pointer) to wxAnimation, so the derived wxAnimation gets sliced to wxAnimation.