将UIImage保存到照片库时,我似乎失去了质量。任何想法如何解决它?这是重要的代码:
res.render({content: content});
这是imageWithView方法:
-(IBAction)aExportPhoto:(id)sender
{
UIImage *main = [self imageWithView:imageFrame];
UIImage *water = [self imageWithView:waterFrame];
UIImage *lign = [self imageWithView:lignFrame];
CGRect fMain = imageFrame.frame;
CGRect fWater = waterFrame.frame;
CGRect fLign = lignFrame.frame;
CGSize sMain = fMain.size;
CGSize sWater = fWater.size;
CGSize sLign = fLign.size;
UIGraphicsBeginImageContext(sMain);
[main drawInRect:CGRectMake(0, 0, sMain.width, sMain.height)];
[lign drawInRect:CGRectMake(fMain.origin.x, sMain.height - 25, sMain.width - 45, 20) blendMode:kCGBlendModeNormal alpha:1.0f];
[water drawInRect:CGRectMake(sMain.width - 45, sMain.height - 35, 40, 40) blendMode: kCGBlendModeNormal alpha: 1.0f];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIImageWriteToSavedPhotosAlbum(newImage, nil, nil, nil);
UIGraphicsEndImageContext();
}
提前致谢!
答案 0 :(得分:0)
您应该UIGraphicsBeginImageContextWithOptions
使用aExportPhoto
,就像在imageWithView
中一样。 UIGraphicsBeginImageContext
使用1
(非视网膜分辨率)的比例,并且您想要使用0
(设备的比例)。