-1

I have an array of images. I want to convert that images into animated gif images. please give me some suggestion. Here is my code:

NSMutableArray *imgAry =[[NSMutableArray alloc]init];
for(int i =0 ;i<arrFiles.count-7;i++){
    [imgAry addObject:[arrImageCache objectAtIndex:i]];
}
NSLog(@"%@",imgAry);
UIActivityViewController * activities = [[UIActivityViewController alloc]
                                         initWithActivityItems:imgAry
                                         applicationActivities:nil];
activities.excludedActivityTypes = [NSArray arrayWithObjects:, nil];

[self presentViewController:activities
                   animated:YES
                 completion:nil];

Nslog of imgAry is

(
    "<UIImage: 0xd082f60>",
    "<UIImage: 0xd083540>",
    "<UIImage: 0xd06af80>"
)
Mathias
  • 5,642
  • 2
  • 31
  • 46
Deepak Thakur
  • 129
  • 2
  • 12

2 Answers2

1

I dont no wy u need activity controller, there is one way u can animate a series of images in the UIImageView, it looks like gif.

for example

  NSMutableArray *Imgarray = [[NSMutableArray alloc]init];

  for(int i=0;i<[Imgarray  count];i++)
  {
    [array addObject:[UIImage imageNamed:[NSString stringWithFormat:@"myGiffImaf%d.png",i]]];
  }


  self.imageView.animationImages = Imgarray;
  self.imageView.animationDuration = 3.0;
  [self.imageView startAnimating];


Shankar BS
  • 8,394
  • 6
  • 41
  • 53
-1

You can conver to .gif. Though I can't give you direct answer but I think you should do some reading of Image I/O. Once I saw that it can convert image format (like .png to .gif). But how you will add multiple image I am not sure about it. I think you also need 3 party tool for this. Once I worked with images and face some problem.

EDIT:

I think you are lucky. This is what you are looking for.

Community
  • 1
  • 1
Rashad
  • 11,057
  • 4
  • 45
  • 73