保存CoreGraphics绘图操作?

时间:2010-02-16 22:38:01

标签: iphone objective-c core-graphics

我有什么办法可以做点什么:

@implementation MyView

- (void)drawRect:(CGRect)rect
{
   // Get the thing I'm supposed to draw (CGImageRef, pattern, etc.) and draw it
   // i.e. not real code
   CGContextDrawWhatever(self.objectThatHoldsDrawing.drawing);
}

1 个答案:

答案 0 :(得分:1)

查看CGPathRefCGLayer(或者甚至只是CALayer,但这大致等同于drawRect:方法)并渲染(例如缓冲)到图像上下文,只是渲染图像。