Search code examples
iphonecocoa-touchuiimageviewuiimageantialiasing

Any quick and dirty anti-aliasing techniques for a rotated UIImageView?


I've got a UIImageView (full frame and rectangular) that i'm rotating with a CGAffineTransform. The UIImage of the UIImageView fills the entire frame. When the image is rotated and drawn the edges appear noticeably jagged. Is there anything I can do to make it look better? It's clearly not being anti-aliased with the background.


Solution

  • Remember to set the appropriate anti-alias options:

    CGContextSetAllowsAntialiasing(theContext, true);
    CGContextSetShouldAntialias(theContext, true);