2013-08-17 48 views

回答

0

我用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]; 
相關問題