Playing animated gif files

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
cmorgan
Posts: 1
Joined: Sun May 20, 2018 3:02 am

Playing animated gif files

Post by cmorgan »

On the desktop I am able to import an animated gif and play it on a different card using this:

put image "airplane.gif" of card "card2" into card image "imageObject"

This doesn't play the animation in the iOS simulator. Is there another way to do this?
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10422
Joined: Fri Feb 19, 2010 10:17 am

Re: Playing animated gif files

Post by richmond62 »

put image "airplane.gif" of card "card2" into card image "imageObject"
I'm not sure what the point of that is.

My inclination would be to check iOS documentation as to how it copes with animated GIF images.
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10422
Joined: Fri Feb 19, 2010 10:17 am

Re: Playing animated gif files

Post by richmond62 »

http://www.idownloadblog.com/2017/07/14/gifroll/
Users have requested animated GIF support for years, but Apple waited until iOS 11 (Fall of 2017) to finally implement it.
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10422
Joined: Fri Feb 19, 2010 10:17 am

Re: Playing animated gif files

Post by richmond62 »

Unfortunately, because of storage constraints,
the way that I tend to handle animated GIFS
(in a way that gives full programmatic control over animation)
is probably not worth considering.
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Playing animated gif files

Post by Klaus »

Hi cmorgan,

welcome to the forum!
Does the GIF on card "card2" play on card "card2"?

Maybe animated GIFs are really not supported by iOS?
I don't know, I don't develop for mobile nor do I own any mobile device like a cellphone etc.

Hint:
... card image xxx
Is only accepted for HC compatibilty, you do not need to write this in LC anymore!
Just use IMAGE or BUTTON or whatever:
...
put img "airplane.gif" of cd "card2" into img "imageObject"
...


Best

Klaus
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2734
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Playing animated gif files

Post by jmburnod »

Hi All,
Possible but very slow (iOS 11.4)
Maybe display a collection of .png would be faster
Best
Jean-Marc
https://alternatic.ch
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10422
Joined: Fri Feb 19, 2010 10:17 am

Re: Playing animated gif files

Post by richmond62 »

Maybe display a collection of .png would be faster
Indeed: If you open an animated GIF in GIMP it is easy (but tedious) to export its frames
as individual images.
-

Code: Select all

on mouseUp
   put 1 into KOUNT
   repeat until KOUNT > 32
      put ("jump" & KOUNT & ".png") into PIK
      set the backGroundPattern of grc "MB" to the ID of img PIK
      add 1 to KOUNT
      wait 3 ticks
   end repeat
end mouseUp
-
jump3.png
jump3.png (15.42 KiB) Viewed 8502 times
jump2.png
jump2.png (16.53 KiB) Viewed 8502 times
jump1.png
jump1.png (16.46 KiB) Viewed 8502 times
-
These stills are extracted from an animated GIF
composed from a sequence of photos by Eadweard Muybridge
that came to 512 KB, as did all the still PNG images:
so NO size overhead, pleasantly enough.
Post Reply