我用过
[UIImage imageWithCGImage:image.CGImage scale:image.scale orientation:UIImageOrientationDownMirrored]
和
[UIImage imageWithCGImage:image.CGImage scale:image.scale orientation:UIImageOrientationUpMirrored];
获得倒置图像,但质量似乎降低了。有没有办法获得倒置图像而没有任何退化?
我尝试使用
-(UIImage*)getHoriMirror:(UIImage*)img
{
CIImage* cii = [CIImage imageWithCGImage:img.CGImage];
cii = [cii imageByApplyingTransform:CGAffineTransformMakeScale(1, -1)];
CIContext *Context = [CIContext contextWithOptions:nil];
CGImageRef cgImage = [Context createCGImage:cii fromRect:[cii extent]];
UIImage* uiImage = [UIImage imageWithCGImage:cgImage];
CGImageRelease(cgImage);
return uiImage;
}
获得倒置图像,但它也降低了输出。 有什么帮助吗?