Download demo project - 24 Kb
Download source files - 5 Kb
Introduction
Often in modern GUI you can see a some sort of window or menu animation that can give a more user friendly "cool" look. Fading or sliding menus, poping dialog boxes look neat and provide visual feedback with user actions. Currently, however there is no simple way to do this under MS Windows, other than XORed lines and polygons (besides the AnimateWindow()
function).
The AnimEffect
class provides quite an easy and extensible way to add animation to your code.
Usage
Using the class is rather simple. Just add the following code to the dialogs OnCreate
and OnDestroy
functions.
AnimEffect ef;
ef.Open( rcWnd );
ef.Close( rcWnd );
You can customize the effect by calling the Setup( int iSteps, int iAfterimages, int iDelay )
member function, and change the animation type by Effect( EffectType effect )
, where EffectType is :
enum EffectType {
Random=-1,
Spin=0,
Vortex,
ScatterGather,
Spike,
Fireworks
};
Included is a simple demo project that shows a bunch of effects. Feel free to use this code.