屏幕截图正在拉伸

时间:2016-04-03 20:06:33

标签: ios objective-c avfoundation

我的项目中有AVFoundation框架,我正在使用previewLayer可见的屏幕截图。当我拍摄屏幕时,图像看起来有点拉伸。如何解决拉伸问题?

CGSize imageSize = [[UIScreen mainScreen] bounds].size;


         UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0);

         CGContextRef context = UIGraphicsGetCurrentContext();

       UIGraphicsPushContext(context);
         [image drawInRect:CGRectMake(0, 0, imageSize.width, imageSize.height)];
         UIGraphicsPopContext();




         [self renderView:self.overlayLabel inContext:context];



         UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext();
         self.screenshotImage = screenshot;
         UIGraphicsEndImageContext();

         UIImageWriteToSavedPhotosAlbum(screenshot, self, nil, nil);

0 个答案:

没有答案