我有什么办法可以做点什么:
@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);
}
答案 0 :(得分:1)
查看CGPathRef
,CGLayer
(或者甚至只是CALayer
,但这大致等同于drawRect:
方法)并渲染(例如缓冲)到图像上下文,只是渲染图像。