あなたがしているように、あなたはUIImageView
そのでX-Axis
はないことをひっくり返していますUIImage
。したがって、明らかにコードは元の画像を保存します。
保存するUIImage
代わりにあなたを裏返します-UIImageView
UIImage *flippedImage = [UIImage imageWithCGImage:sourceImage.CGImage scale:1.0 orientation: UIImageOrientationUpMirrored];
今あなたの保存方法を使用してください-
UIImageWriteToSavedPhotosAlbum(flippedImage, nil, nil, nil);
編集:
-(void)tapFlipXPosition:(id)sender
{
UIImage* sourceImage = yourSourceImage;
UIImage* flippedImage;
if(sourceImage.imageOrientation == UIImageOrientationUpMirrored)
{
flippedImage = [UIImage imageWithCGImage:sourceImage.CGImage scale:1.0 orientation: UIImageOrientationUp];
}
else
{
flippedImage = [UIImage imageWithCGImage:sourceImage.CGImage scale:1.0 orientation: UIImageOrientationUpMirrored];
}
UIImageWriteToSavedPhotosAlbum(flippedImage, nil, nil, nil);
}