I created an application, in which I can rotate, re-size, translate an image using gestures. Then I need to get the image from the UIImageView. I found this part of the code at some where in Stack-overflow. Although the smiler question is answered here, but it requires the input of the angle. The same person wrote somewhere else the better solution, which I'm using. But it have a problem. Often it returns a blank image. or truncated image (often from top side). So there is something wrong with the code and it requires some changes. My problem is that, I'm new to Core-graphics and badly stuck in this problem.

EDIT 1.1
Thanks for the sample code, but again it have the problem. Let me explain in more detail, I'm using gestures for scaling, translating and resizing the image using imageview. So all this data is saved in the transform property of the imageview. I fond another method in core-image. So I changed my code to:

you can use CoreImage framework to rotate image it is for iOS 5.0 or later but its really better that core graphics..
–
LeenaApr 6 '12 at 5:38

thanks for the tip. can you provide any link or sample? Sorry I know very little about core image.
–
andyApr 6 '12 at 16:43

ok i just provide you sample code and link to the documentation.
–
LeenaApr 7 '12 at 4:55

Just for the record, I needed merging 2 UIImages and thus I had problem as you - how to get UIImage from UIImageView transformed with CGAffineTransformation. Your code from EDIT 1.1 helped me and works for my purposes.
–
uercegJan 22 '13 at 7:26