Skip to content

Instantly share code, notes, and snippets.

@sbrocket
Created January 14, 2009 01:24
Show Gist options
  • Select an option

  • Save sbrocket/46730 to your computer and use it in GitHub Desktop.

Select an option

Save sbrocket/46730 to your computer and use it in GitHub Desktop.
- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
CGContextTranslateCTM(context, 0, rect.size.height);
CGContextScaleCTM(context, 1, -1);
// Do some drawing with CGContextDrawImage()
CGContextRestoreGState(context);
// Do some drawing with -[NSString(UIDrawing) drawInRect:]
CGContextSaveGState(context);
CGContextTranslateCTM(context, 0, rect.size.height);
CGContextScaleCTM(context, 1, -1);
// Do some drawing with CGContextDrawImage()
CGContextRestoreGState(context);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment