简体   繁体   中英

display and create gif image on iPhone

I am googling for the answer from last few hours. I know that Apple and Facebook do not support gif images, I wants to display and create gif image in an iPhone App, I find the alternate solution that make the image sequence and give animation. I wants to create the GIF image from these images and post on Facebook wall.

When I was googling about Facebook and Apple, it shows 2 years old answers. May be now apple and Facebook changed their policies, Is this possible to create GIF image on iPhone App and post to it on Facebook?

According to this stack overflow question here does Apple support gif images?

UIImageView* animatedImageView = [[UIImageView alloc] initWithFrame:self.view.bounds];
animatedImageView.animationImages = [NSArray arrayWithObjects:    
                           [UIImage imageNamed:@"image1.gif"],
                           [UIImage imageNamed:@"image2.gif"],
                           [UIImage imageNamed:@"image3.gif"],
                           [UIImage imageNamed:@"image4.gif"], nil];
animatedImageView.animationDuration = 1.0f;
animatedImageView.animationRepeatCount = 0;
[animatedImageView startAnimating];
[self.view addSubview: animatedImageView];

I've been able to create animated gifs on iOS using ImageMagick. There are a number of tutorials out there. Here is one . And here is ImageMagick compiled for iOS .

What I wasn't able to sort out (due to time) was how to get the benefit of compression by using palettized images and other gif compression methods. That wold be something to look into as I found the images I was able to create were quite large.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM