开发者

UIImage from UIView has too big size

I have small section of code below:

- (UIImage *)imageFromView:(UIView *)myView{
if (UIGraphicsBeginImageContextWithOptions!=NULL)
{
    UIGraphicsBeginImageContextWithOptions(myView.bounds.size,NO,0.0); 
}
else 
{
    UIGraphicsBeginImageContext(myView.bounds.size);
}
[myView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return [[viewImage retain] autorelease];

}

After getting UIImage from this function. I save it into photo library. But the size of image is too big. It's pretty different from original image. Anyone has s开发者_如何学Pythonolution for this. Please help me. Thank you all so much.


NSLog() the current myView.Bounds.size and also check which statement gets called.
How big is your image and how big should it be?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜