Forms transitions and animation?

M

mrabie

Hi,

I am writing an application where i want to do nice transition
effects, i thought of the following,
1) Main form1 is loaded and shown on screen
2) Load form2 in an offscreen buffer
3) capture bitmap image of the form (after the form has been loaded in
the offscreen buffer)
4) capture bitmap image of form1
5) make transition effect by double buffering

the problem is that i am not able to load the form into an offer
screen buffer... is that possible?

the other idea i thought about is to follow the same steps above but
instead of loading the form in an off screen buffer, i load the form
and setting the bounds to out of the screen and then capture the image
but i get a blackscreen when this is done. e.g

form2.location = new Point(240,0);
form2.Show();

Bitmap Snapshot = this.SnapShot(gxbuffer, new
Rectangle(240,0,240,320);

any ideas or help would be really appreciated

Thanks
 
M

mrabie

Hi,

I am writing an application where i want to do nice transition
effects, i thought of the following,
1) Main form1 is loaded and shown on screen
2) Load form2 in an offscreen buffer
3) capture bitmap image of the form (after the form has been loaded in
the offscreen buffer)
4) capture bitmap image of form1
5) make transition effect by double buffering

the problem is that i am not able to load the form into an offer
screen buffer... is that possible?

the other idea i thought about is to follow the same steps above but
instead of loading the form in an off screen buffer, i load the form
and setting the bounds to out of the screen and then capture the image
but i get a blackscreen when this is done. e.g

form2.location = new Point(240,0);
form2.Show();

Bitmap Snapshot = this.SnapShot(gxbuffer, new
Rectangle(240,0,240,320);

any ideas or help would be really appreciated

Thanks

also what's the best way to show the transition without flikering? and
transition code or sample would be great.

Thanks
 
S

Simon Hart [MVP]

Usally override the OnPaintBackground event, but do nothing. Leave the
painting to the WM_PAINT event.
 
M

mrabie

Usally override the OnPaintBackground event, but do nothing. Leave the
painting to the WM_PAINT event.
--
Simon Hart
Visual Developer - Device Application Development MVPhttp://simonrhart.blogspot.com







- Show quoted text -

Well i took a look at FlowFX wonderful app, i learned a lot from it
especially how to make the actual transiotion effect. what he does is
that he captures an image of a blank form (and if the new form has a
bg color he adds the bg color to the buffer while in transition), but
not actually getting the form with all it's controls over it, eg. if i
have a picturebox on Form2 it wont show up in the transition, only
after the transition is over and the form is loaded onto screen, the
controls start rendering over it.
Any ideas how to reach it?

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top