-1
我需要從這個庫中獲得不同顏色的GIF:https://github.com/samvermette/SVPulsingAnnotationView我可以從自定義的MKAnnotationView中獲得gif嗎?
在圖書館裏我有機會獲得MKAnnotationView層。但我需要生成的註釋的動畫gif用於非iOS項目。
我需要從這個庫中獲得不同顏色的GIF:https://github.com/samvermette/SVPulsingAnnotationView我可以從自定義的MKAnnotationView中獲得gif嗎?
在圖書館裏我有機會獲得MKAnnotationView層。但我需要生成的註釋的動畫gif用於非iOS項目。
我用renderInContext
從CALayer(結果)創建PNG。然後我使用python創建了gif。
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];