How to do antialiasing on a rotated view?

cocoa-touch, iphone, uikit

Solution

For a UIImageView, add a one-pixel transparent border around the image. This will cause the edges of your image to be on the "inside", and because the inside pixels are interpolated when rotating, the borders will magically become antialiased. This also works for rotating UIButtons that have a custom image.

Problem

Possible Duplicate: Any quick and dirty anti-aliasing techniques for a rotated UIImageView? when a UIView is rotated, it's borders look incredible ugly. There's no antialiasing happening at all. Also if it's a UIImageView, no antialiasing happens when rotating the transform matrix. Is there a way to achieve smooth edges and smooth rotation of images?

Original source

Related problems