locked
How can i create animated gif file ? RRS feed

  • Question

  • I mean if i can create an empty bitmap file in the double of the size of the first image i have for example i have a gif wich is 50kb so i create a new bitmap file in 100kb.

    So i can put in the new file two gifs for example of 50kb each.

    The problem is how can i make something like pause or something that will move between the images something that will show me in the new file the first 50kb and then the last 50kb ?

     

     


    danieli
    Friday, May 13, 2011 2:37 PM

Answers

  • You may use a multipage tiff instead of a bitmap file. So you can do something with the framelist, For example if the tiff has two pages then

          inputImg = Image.FromFile(imgFileName);
          FrameDimension dimension1 = new FrameDimension(inputImg.FrameDimensionsList[0]);
    
     FrameDimension dimension1 = new FrameDimension(inputImg.FrameDimensionsList[1]);
    
         // select the first frame / image 
         inputImg.SelectActiveFrame(dimension1, 0);
    
         // select the second frame / image 
         inputImg.SelectActiveFrame(dimension2, 1);<br/>     <br/>     //display the active frame in the picturebox<br/>     picturebox1.image=inputImg <br/>
    

    You can use a timer to swap the frames. To know more about creating and handling multipage tiffs refer the following links

    http://www.codeproject.com/KB/GDI-plus/SaveMultipageTiff.aspx

    http://www.atalasoft.com/docs/dotimage/docs/multipage.html

    http://www.codeproject.com/KB/cs/multipagetiffviewer.aspx

     

    Good luck

    • Marked as answer by chocolade Friday, May 13, 2011 10:36 PM
    Friday, May 13, 2011 3:31 PM