iPhone: anti-aliasing after rotating
I've load an image into narrow UIImageView - the width is 3px, the height is approx. 10
Then I've rotate the view - and I've got not p开发者_开发技巧leasant picture, with visual distortion (like http://upload.wikimedia.org/wikipedia/commons/f/fd/Anti-aliased-diamonds.png on the left part of picture). Is any way to fix it? Does Quartz let anti-alias pictures?
if you are rotating using UIView's transform
property or rotating via the view's layer
: you can produce superior looking results with quartz's apis directly.
you can create a higher quality image using a quartz image process which creates a new image and specify high quality with anti-aliasing for the transform and rendering.
this image process could be implemented many ways, such as CGContextRotateCTM
followed by CGContextDrawImage
, then accessing the new image with CGBitmapContextCreateImage
.
alternatively, you may prefer to draw the image directly to the context rather than creating an intermediate.
精彩评论