-1

I need to get gifs with different colors from this library: https://github.com/samvermette/SVPulsingAnnotationView

In the library I have access to the layer of the MKAnnotationView. But I need an animated gif of the generated annotation to use in a non-iOS project.

Aboelseoud
  • 556
  • 1
  • 7
  • 22

1 Answers1

0

I used renderInContext to create pngs from the CALayer (result). Then I created the gifs using python.

UIGraphicsBeginImageContextWithOptions(result.bounds.size, result.opaque, 0.0);
[result renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
NSString *pngFilePath = [NSString stringWithFormat:@"%@/blue dot.png",docDir];
NSData *data1 = [NSData dataWithData:UIImagePNGRepresentation(image)];
[data1 writeToFile:pngFilePath atomically:YES];
Aboelseoud
  • 556
  • 1
  • 7
  • 22