开发者

Capture UIImageView context

I am trying capture开发者_高级运维 UIIMage with UIGraphicsBeginImageContext(); but my code capture the whole screen then save it into photo library ...

UIGraphicsBeginImageContext(self.view.frame.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext();
UIImageWriteToSavedPhotosAlbum(screenshot, nil, nil, nil);
UIGraphicsEndImageContext();

I just want capture my UIImageView things on it ! ... any suggest ?


Found it ! :

UIGraphicsBeginImageContext(image.bounds.size); [image.layer renderInContext:UIGraphicsGetCurrentContext()];

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜