この画像レンダリング機能があり、レンダリング時にメイン/UIスレッドがブロック/スタッターします。
iOSでスレッドとレンダリングを別のスレッドでブロックしないようにする方法は何ですか?役立つネイティブAPIはありますか?
コードで更新:
+ (UIImage *)imageWithImage:(UIImage *)image scaledToSize:(CGSize)newSize {
//UIGraphicsBeginImageContext(newSize);
UIGraphicsBeginImageContextWithOptions(newSize, NO, 0.0);
[image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}
function
{
UIImage *shrinkedImage = [ThisClass imageWithImage:screenShotImage scaledToSize:shrinkImageToSize];
UIImage * rotatedImage = [[UIImage alloc] initWithCGImage: shrinkedImage.CGImage
scale: 1.0
orientation: UIImageOrientationRight];
}
ありがとう