Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image Transition 2

Status
Not open for further replies.

mander23

MIS
Jan 30, 2005
28
US
I am creating a slideshow in C#.Net. I was wondering if any one knew how to put transition effects on the images when they change. Any help will be appreciated. Thank you.
 
What kind of transition effects are you looking for in particular?
 
Something similar to the ones in powerpoint. Anything along those lines is what I am looking for. Do you have something in mind. Thank you.
 
To create the transitions you will want to draw the images using GDI+. It's actually quite easy. For the more fancy effects - even better than those of powerpoint, take a look into the Image Processing Lab project on CodeProject.



In terms of creating your application, I would create a generic interface ITransition that has one method:

BeginTransition(Image from, Image to, int milliseconds);

Then each of your transitions would inherit this interface and your application suddenly becomes scalable.

Hopefully that gets you started.
 
Thank you for the info. Could you provide an example of this using the gdi+. Thank you again.
 
Generally you need to invoke the redraw of the control that is drawing the image. Let's say in this case it's a PictureBox.


pictureBox1.Invalidate(); //cause the picturebox to redraw

and you should have an event handler to react to the Paint event of the PictureBox.

private void pictureBox1_Paint(object sender, EventArgs e)
{
//now you can draw things on the picturebox

e.Graphics.DrawRectangle(Pens.Red, 0,0,25,25);

//you can also draw images or parts of images here
}


if you want to constantly redraw this picturebox during a transition - use a timer and make your timer_tick invalidate the pictureBox.
 
i've been thinking of trying my hand at graphics.
this gives me a place to start.
many thanks.
*



mr s. <;)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top