Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
OTHER >>  HOW TO CREATE AN ANIMATED .GIF WITH IMAGEMAGICK

  Chris Chamberlain
  Where is Chris Chamberlain?
 GL6 0PN
 United Kingdom
 Chris Chamberlain



In Thread ID:221884, the question asked was 'is the creation of an animated .gif within the scope of GdiPlus?'

Cesar's comment was 'the version of GdiPlus.dll that VFP uses does not not have functions to create animated GIFs'.

Until such time as such functionality exists with GdiPlus, the following alternative methodology does provide a way to allow a user or developer to programatically create an animated .gif.

Download and install ImageMagick from http://www.imagemagick.org/script/index.php, making sure the version selected contains the ImageMagickObject.dll. The object will be registered during the installation process.

You will need to study the ImageMagick documentation in depth to fully understand how it works.

The barebones code that follows will create an animated gif.

Note there is no need to use "" with filenames containing spaces.

oIM = CREATEOBJECT([ImageMagickObject.MagickImage.1])

lcFile1 = [C:\pictures\expanded\picture 043.png] && Fully qualified path\filename
lcFile2 = [C:\pictures\expanded\picture 044.png]
lcFile3 = [C:\pictures\expanded\picture 045.png]
lcDelay = [-delay] && Required otherwise no delay
lnDelay = [300] && Change delay value to suit
lcAniGif = ADDBS(SYS(5); && Required output filename
+ SYS(2003)) ; && with fully qualified path
+ [output\output.gif]

oIM.Convert( ;
lcFile1 ,;
lcFile2 ,;
lcFile3 ,;
lcDelay ,;
lnDelay ,;
lcAniGif)

oIM = .NULL.
RELEASE oIM

FEEDBACK

GURI SINGH @ 3/27/2010 1:02:38 PM
gurbachan



Your Name: 
Your Feedback: 

Spam Protection:
Enter the code shown: