Possible Duplicate:
Any quick and dirty anti-aliasing techniques for a rotated UIImageView?
I wanted to change the angle of an UIImageView in my iPhone and app i used the following code:
previewImg.transform = CGAffineTransformMakeRotation(atan2(y2-y1,x2-x1));
and I got it working and the image is below.

In the image, the edges of the image is not smooth. Is there any way to smoothen the edges?
This has been asked before, check this post here, Any quick and dirty anti-aliasing techniques for a rotated UIImageView?
With that said, the optimal solution would be to create a 1px transparent border around your image.
UPDATE: Here’s a helper method to add a transparent border to a
UIImage, referenced from here: http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/