我有self.view,但我只想捕捉它的300x320。
得到这个代码:
UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.window.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);
UIImage * imgPrintScreen = [[UIImage alloc]init];
imgPrintScreen = viewImage;
为了这样做,我需要在这里更改什么?
感谢分配!