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行追加するだけで毎回画像全体を描画するのは非常にコストがかかると思うことです.誰もそれを最適化する方法を知っていますか?