CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2001
    Posts
    20

    How can I play a animation gif image in form in Visual Basic.

    I want to display a animation gif image in a visual basic form. So I long the help from someones.
    Thanks .
    Luu Truong Huy


  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: How can I play a animation gif image in form in Visual Basic.

    You can use the webbrowser control to do that. Use the navigate function to go to the picture. This leaves some whitspace at the top and at the left side, so you need to move the control a bit. The best way to do this is to place the control inside a picturebox. After that, you can use the picturebox to give the control the correct height/width


    ' load the picture
    Webbrowser1.navigate "c:\mygif.gif"

    ' move the control to get rid of whitespace
    WebBrowser1.Move -ScaleX(12, vbPixels, vbTwips), -ScaleY(20, vbPixels, vbTwips), Screen.Width, Screen.Height

    ' resize the picturebox by loading the file, and then using autosize
    Picture1 = LoadPicture("c:\mygif.gif")
    Picture1.AutoSize = true




    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  3. #3
    Join Date
    Jan 2000
    Location
    The Netherlands, Overijssel
    Posts
    733

    Re: How can I play a animation gif image in form in Visual Basic.

    look at:
    http://www.maxcode.com/
    and then the following category:
    Sourcecodes->Visual Basic->Graphics


    All At http://www.maxcode.com/
    ------------------------------------
    Clemens Timmermans (17-Year old)
    -------------------------------------
    - 'The Matrix has you, NEO' -(quote from: the Matrix)
    [url=http://www.maxcode.com/modules.php?name=Topics] Articles [url] | [url=http://www.maxcode.com/modules.php?name=Downloads&d_op=viewdownload&cid=4]
    Compilers [url] | [url=http://www.maxcode.com/modules.php?name=Downloads]Code Samples[url]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured