How to show a gif animation on a form ?
-
Put a PictureBox on the form and in the code type the following when you want to display the gif.
PictureBox.Image = New Bitmap("GIF PATH")
Where PictureBox is the name of the picturebox and "GIF PATH" is the path of a gif file. If you have a stream loaded with the gif picture in use the following:
PictureBox.Image = New Bitmap(GIF STREAM)
Where PictureBox is the name of the picturebox and GIF STREAM is the the stream. This can be useful if the gif is an embedded resoource in your app. In such a case (The gif is an embedded resource) use:
PictureBox.Image = New Bitmap(GetType(FormName).Assembly.GetManifestResourceStream(("GIF RESOURCE NAME")
Where PictureBox is the name of the picturebox, FormName is the name of the form and "GIF RESOURCE NAME" is the complete name of the gif including any folders and the root namespace of your project and the .gif file extension. eg: "MyProject.MyGif.gif" All this works for animated gifs as well. Hope it's useful. I also hope I didn't misunderstand you and that you actually meant 'How to programatically create an animated gif'