I would Like to save UIImage
with rotation in drawInRect
.
I am having four UImageView
objects from which second and third has Rotation of 100 degree and 250 degree respectively.
So can anyone tell me how can I give rotation to those images which are inside UIImageView
?
问问题
623 次
1 回答
0
我希望它能帮助你解决你的问题,
对于 100 度旋转,如果您想保持 250 度,请将 100 替换为 250 度。
100度
(UIImageview *).transform = CGAffineTransformMakeRotation(1.744);
250度
(UIImageview *).transform = CGAffineTransformMakeRotation(4.36);
此代码是根据您的要求
UIGraphicsBeginImageContext( newSize );
[bottomImage drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
//I want Rotation for second and third Image//
[secondImage drawInRect:CGRectMake(0, 0, 110, 300)];
secondImage.transform = CGAffineTransformMakeRotation(1.744);
[thirdImage drawInRect:CGRectMake(0, 0, 110, 300)];
thirdImage.transform = CGAffineTransformMakeRotation(4.36);
[fourthImage drawInRect:CGRectMake(0,0,fourthImage.size.width ,fourthImage.size.height )];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
于 2013-07-29T07:28:35.110 回答