我正在制作一个应用程序,我必须在每个周期绘制一定数量的图像。 此数字可能因某些用户操作而异。 当数字开始增长到应用程序变得非常慢时,速度性能对它来说是最重要的。
此时我很好地吸引了这些人:
//打开上下文
IGraphicsBeginImageContext(gameImage.frame.size);
//绘制所有图像 // imagemref是UIImage的NSArray
CGContextDrawImage(UIGraphicsGetCurrentContext(), CGRectMake(x,y, sizeX, sizeY),[[imagemref objectAtIndex:i] CGImage]);
//结束语境
gameImage.image = UIGraphicsGetImageFromCurrentImageContext();
[gameImage setAlpha:opacidade];
UIGraphicsEndImageContext();
如果有人有更有效的绘画方式。我很喜欢学习