A: 

Your problem here is the anchor of your CALayer, I dont have example code right here with me, but if you play with the anchor property of the view CALayer you should be able to get the view to look like you want. I will try and post some sample code later

Daniel
Would be great thanks.
Ton
do you have screenshots of the rotated view? i might be able to come up with what the anchor needs to be set at if i look at it
Daniel
assuming that thats what the problem is :)
Daniel
Its actually the same as my example image above, the degree and image size are pretty much identical.
Ton
I added another image, i my edit. I hope this will clarify it a bit more, its just a "done" system button png. Its also mirrord right now but that will be of later conern, i first want it to rotate right.
Ton
i mean display it right, the rotation itself is working.
Ton
Do you see whats going on then? The view is anchored at 0,0, you are rotation counter clock wise (right?) so since the view is achored at 0,0 when you rotate the view is disappearing on the top there, try setting the anchor to .5,.5 and see what results you get, (wont be perfect but you might be able to figure it out) let me know if im on the right track
Daniel
Daniel i don't know how to set the anchor point.
Ton
i found it, going to try it out now.
Ton
i had to import #import<QuartzCore/QuartzCore.h> for using anchorpoint. I used this:UIImage *image3=[self rotateImage];imageView.layer.anchorPoint=CGPointMake(.5,.5);imageView.image = image3;but it didin't work.
Ton
you gotta set the anchor point before you rotate the image
Daniel
the only thing that happens is that my UIImageview will get another x/y position when is set the anchorpoint.
Ton
When i use UIImageView.transform = CGAffineTransformMakeRotation(M_PI*0.25)My image is correctly displayed, but it get jagged edges on my image.
Ton
UIImageView.transform i mean imageView.transform
Ton
unfortunatly thats what happens when you do the rotation you get the jagged edges =/
Daniel
A: 

I solved it now, i have to change the width/height value of bounds and the x/y in CGContextDrawImage

CGRect bounds = CGRectMake(0, 0, width+10, height+10);
CGContextDrawImage(UIGraphicsGetCurrentContext(), CGRectMake(10,0,width,height), imgRef);
Ton
I know this will solve the problem, but I think it is not a final solution, as you may have to change these values to bigger numbers as you increase the size of the image being transformed. Have you by any chance found the real solution for that? thanks.
Digital Robot