Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to show a gif animation on a form ?

How to show a gif animation on a form ?

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cylix2000
    wrote on last edited by
    #1

    As the title, Thank you!

    S D 2 Replies Last reply
    0
    • C cylix2000

      As the title, Thank you!

      S Offline
      S Offline
      sathish s
      wrote on last edited by
      #2

      Did you try using a picture box?

      1 Reply Last reply
      0
      • C cylix2000

        As the title, Thank you!

        D Offline
        D Offline
        D111
        wrote on last edited by
        #3

        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'

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups