Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When I rotate an UIImageView with the transform property, the edges pixellate [duplicate]

Possible Duplicate:
How to do antialiasing on a rotated view?

I'm trying to rotate some UIImageViews using this technique:

imageView.transform = CGAffineTransformMakeRotation(r);

where r is a float usually between -0.3 and 0.3.

The problem is that the images (which are derived from square jpegs) that are rotated have jagged edges (pixellation), because they are at an angle after the transform. Is there a way to fix this so the edges are smooth (i.e. antialiased)?

like image 590
dan Avatar asked Aug 16 '11 14:08

dan


1 Answers

There is a key that you can set in Info.plist that enables antialiasing of the edges: UIViewEdgeAntialiasing.

http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html

like image 186
Johan Kool Avatar answered Sep 16 '22 15:09

Johan Kool