I am struggling getting Image Insets to work when drawing to an off screen buffer.
Using the resizableImageWithCapInsets: on an UIImage directly setImage: into a but
I would guess that stretchable UIImages are handled at a higher level than Quartz2D and so using CGContextDrawImage
is not going to work.
You could try using -[UIImage drawInRect]
instead. This will draw to the current UIGraphics context, which is your bitmap context that you create in your code snippet.
The relevant line is:
[base drawInRect:CGRectMake(0,0,self.bounds.size.width,
self.bounds.size.height)];