我想在我的 UIIMage 上再画 1 条线,现在我这样做:
-(void)drawRect
{
UIGraphicsBeginImageContext(myImage.size);
code to draw line on current context...
draw previous info from myImage:
[myImage drawInRect:myRect];
//store info from context back to myImage
myImage=UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
//append the image on the right side of current context:
[myImage drawInRect:myRightRect];
}
问题是我认为每次只为增加 1 行绘制整个图像非常昂贵,有人知道如何优化它吗?