Creating a simple animation on a window
Login to reply to this topic.
lun, 2008-12-01 14:27
Joined: 2008-10-17
Forum posts: 18

Hi,

I would like to implement bitmap animtion...i went through the various Classes(CBitmapAnimClientData) present in symbian to achieve this....But in my case my application is a single window application....so i felt that these classes might create a new window for just the animation(which i dont prefer)....
I would like to know three things:

1.Is it possible to draw and update the animation in an already present window rather than using a new window.
2.Will creating a new window be supporting transparency,since i dont want the animation to block a part of my actual window.
3.Or is it simpler to create my own animation using a timer function.If YES is it efficient.(Mine is just going to be a simple small animation per window)

It would also be gr8 if you can just give me some guidelines on how to do this using a Timer and active objects.

Thanx...
Navin


mar, 2008-12-02 10:42
Joined: 2004-11-29
Forum posts: 1419

If its just a simple bitmap animation, with a low framerate (say, below 15 fps or so), just letting a timer update the state (increase frame number) and call DrawNow() should be enough.

CPeriodic is a very easy-to-use animation timer.

Create a static callback:

TInt CMyClass::MyTimerCB(TAny* aArg)
{
 CMyClass* self = (CMyClass*)aArg; // to be able to access members, since statics functions can't use "this" ptr

  return ETrue; //Return false to stop timer.
}

and create and start a CPeriodic member:

 iTimer = CPeriodic::NewL(CActive::EPriorityStandard);
 iTimer->Start(KFrameIntervalInMicroSeconds, KFrameIntervalInMicroSeconds, TCallBack(MyTimerCB, this));


copyright 2003-2009 NewLC SARL