5
我想快速捕捉製作圖像視頻的截圖。我目前使用下面的代碼,但稍微延遲了。有更好的方法來獲取更快的截圖嗎?iOS屏幕截圖延遲
CGSize imageSize = [[UIScreen mainScreen] bounds].size;
if (NULL != UIGraphicsBeginImageContextWithOptions)
UIGraphicsBeginImageContextWithOptions(imageSize, NO, 1);
else
UIGraphicsBeginImageContext(imageSize);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *imageName = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();