I've got a simple script that can display an animated gif.

I think that it could be improved.  It's a bit slow loading the gif, and it
doesn't handle the missing information from some frames (changes from
I-frames [in MPEG speak]) and it doesn't handle transparent backgrounds.
Oh, and there's no error checking.

I tried to add enough comments so everyone can understand what I did.

If you make any improvements, please share them with the list (or at least
with me)

Would this be a good script to add as an example script with the Win32::GUI
distribution?

Enjoy!  I hope this helps someone!

Brian Millham
This message traveled at least 44,000 miles to reach you!
Creator of the DW6000 Monitor
http://www.millham.net/dw6000
[EMAIL PROTECTED]

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Steve Loughran
Sent: Tuesday, September 26, 2006 4:26 PM
To: perl-win32-gui-users@lists.sourceforge.net
Subject: Re: [perl-win32-gui-users] [win32-gui] DIBitmap and Animated GIFs?

Frame timing:

$delay = $image->[$frame_count]->Get('delay');

(I think!).

Still having some issue with anims (I think its PerlMagick thats causing 
the problems), but its most certainly getting there :)

Steve

> So now I'm working on this.  I can now get individual frames from an
> animated gif.
> 
> $image = Image::Magick->new();
> $image->Read('ani.gif');
> $framecount = $#$image;
> $frame0 = $image->[0];
> $frame1 = $image->[1];
> 
> Note the difference from your example.  Not $image[0] but $image->[0].
> 
> Now I need to display the images in a Win32::GUI window, and figure out
the
> timing.
> 
> Brian Millham
> This message traveled at least 44,000 miles to reach you!
> Creator of the DW6000 Monitor
> http://www.millham.net/dw6000
> [EMAIL PROTECTED]
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Glenn Linderman
> Sent: Monday, September 25, 2006 10:57 PM
> To: Brian Millham
> Cc: perl-win32-gui-users@lists.sourceforge.net
> Subject: Re: [perl-win32-gui-users] [win32-gui] DIBitmap and Animated
GIFs?
> 
> On approximately 9/25/2006 7:21 PM, came the following characters from 
> the keyboard of Brian Millham:
>> As I revisited this, I remembered that my problem with ImageMagick was
> with
>> threads, not Win32::GUI (ImageMagick doesn't seem to work at all with
>> threads).
>>
>> I've been playing with this, and ImageMagick can read animated gif's.  I
>> haven't figured out how to get individual frames from the animation.  All
> I
>> can get is the first frame...
> 
> Try using subscripts.  Maybe something like this would work... You can 
> also get help on the imagemagick mailing list.
> 
> $image = Image::Magick->new();
> $image->Read('ani.gif');
> $framecount = $#$image;
> $frame0 = $image[ 0 ];
> $frame1 = $image[ 1 ];
> 
> etc.
> 
> You get to add the bounds checking and error checking.  Animated GIF 
> files, IIRC, are not always full-frame, but deltas?  That's all I think 
> I know about them, but I could be wrong.  So I'm not sure if you display 
> the frames individually that they will be what you expect, but if you 
> are into animated GIFs, maybe they will be what you expect.
> 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/
---
avast! Antivirus: Inbound message clean.
Virus Database (VPS): 0639-2, 09/26/2006
Tested on: 9/26/2006 5:05:55 PM
avast! is copyright (c) 2000-2006 ALWIL Software.
http://www.avast.com



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0639-2, 09/26/2006
Tested on: 9/26/2006 9:45:47 PM
avast! is copyright (c) 2000-2006 ALWIL Software.
http://www.avast.com



  

Attachment: animatedgif.pl
Description: Binary data

Reply via email to