ZFScreenRecorder icon indicating copy to clipboard operation
ZFScreenRecorder copied to clipboard

第一次开始录屏 卡顿几秒钟

Open kunlingyijia opened this issue 1 year ago • 0 comments

// 获取view的截图图片 void ZFSnapshotViewInRect(UIView *view, CGRect rect,CGImageRef *imageRef) {

UIGraphicsBeginImageContextWithOptions(CGSizeMake(rect.size.width/2.0, rect.size.height/2.0), NO,  0.0);
CGContextRef ctx = UIGraphicsGetCurrentContext();
if (!ctx) {
    NSLog(@"-------截图图片 失败");
    imageRef = nil;
}
[view drawViewHierarchyInRect:rect afterScreenUpdates:FALSE];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
*imageRef = image.CGImage;

}

kunlingyijia avatar Nov 24 '23 02:11 kunlingyijia