我正在尝试使用UIGraphicsBeginImageContext();
捕获UIIMage,但我的代码捕获整个屏幕,然后将其保存到照片库...
UIGraphicsBeginImageContext(self.view.frame.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext();
UIImageWriteToSavedPhotosAlbum(screenshot, nil, nil, nil);
UIGraphicsEndImageContext();
我只想抓住我的UIImageView上的东西! ... 任何建议?
答案 0 :(得分:0)
UIGraphicsBeginImageContext(image.bounds.size); [image.layer renderInContext:UIGraphicsGetCurrentContext()];