画像に描画しようとしている次の方法があります。
- (UIImage*) renderImage
{
UIGraphicsBeginImageContextWithOptions(self.size, NO, 0);
CGContextRef context = UIGraphicsGetCurrentContext();
//drawing code
UIImage *image = [UIGraphicsGetImageFromCurrentImageContext() retain];
UIGraphicsEndImageContext();
return [image autorelease];
}
このコードを実行すると、単純にこのコードdrawRect
をUIView
. ここで間違ったグラフィックス コンテキスト (つまりCGContextRef context = UIGraphicsGetCurrentContext();
) に描画していますか? それともUIGraphicsGetImageFromCurrentImageContext
、描画よりもはるかに高価drawRect
ですか?