get the UIImage (or CGImage) from drawRect
问题 I'm calling the following code from drawRect - (void) drawPartial:(UIImage *)img colour:(UIColor *)colour { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSaveGState(context); CGContextTranslateCTM(context, 0.0, self.bounds.size.height); CGContextScaleCTM(context, 1.0, -1.0); CGContextDrawImage(context, self.frame, img.CGImage); if (colour!=nil) { CGContextSetBlendMode (context, kCGBlendModeColor ); CGContextClipToMask(context, self.bounds, img.CGImage); CGContextSetFillColor