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()];
精彩评论