我有一个 CGBitmapContext (bitmapContext),我想将它的一些矩形部分 (rect) 绘制到当前 CGContext (context) >).
现在我就是这样做的:
CGContextRef context = UIGraphicsGetCurrentContext();
CGImageRef cgImage = CGBitmapContextCreateImage(bitmapContext);
CGContextClipToRect(context, rect);
CGContextDrawImage(context, CGRectMake(0, 0, width, height), cgImage);
CGImageRelease(cgImage);
这是最佳的吗?最好的方法是什么?
最佳答案
替代方案似乎是创建一个子图像,我只能想象这不太理想。
关于iphone - quartz 2D : draw from a CGContext to another CGContext,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3043972/