![](/img/trans.png)
[英]How to save an image using UIImageWriteToSavedPhotosAlbum after it is transformed
[英]save image with UIImageWriteToSavedPhotosAlbum after rotation of the image
UIImageWriteToSavedPhotosAlbum() 在我旋轉圖像之前工作得很好。 根據條件,我想在保存之前旋轉圖像。 但是當我這樣做時,它恰好只有在旋轉后才具有低分辨率。
UIGraphicsBeginImageContextWithOptions(selectedPhoto.bounds.size, self.view.opaque, 2.0);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
myImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
if (rotate == true) {
myImage = [myImage imageRotatedByDegrees:-90];
UIImageWriteToSavedPhotosAlbum(myImage, nil, nil, nil);
}else {
UIImageWriteToSavedPhotosAlbum(myImage, nil, nil, nil);
}
有什么提示嗎?
給你go。在orientation上設置具體方向。 使用時不要忘記釋放rotatedImage。
UIImage *rotatedImage = [[UIImage alloc] initWithCGImage: originalImage.CGImage
scale: 1.0
orientation: UIImageOrientationLeft];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.