2013-07-29 2 views
0

UIImage을 축하하고 drawInRect에 저장하고 싶습니다.
I은 ​​ 및 제 각각 100도 및 250도 회전을 갖는 UImageView에서 4 개체를 구비하고있다.
아무도 내가 UIImageView 안에있는 이미지에 어떻게 회전시킬 수 있습니까? 나는 당신이 당신의 문제를 해결하는 데 도움이되기를 바랍니다그림을 직사각형으로 그리는 도형으로 그리기

답변

0

100도 회전을 위해 당신은 250도 100을 교체하십시오 250 학위를 유지하려는 경우.

100도 250의 degress에 대한

(UIImageview *).transform = CGAffineTransformMakeRotation(1.744); 

(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(); 
+0

이 내 코드입니다 .. UIGraphicsBeginImageContext (newSize와)에 따라입니다; [bottomImage drawInRect : CGRectMake (0,0, newSize.width, newSize.height)]; // 두 번째 및 세 번째 이미지의 회전을 원합니다 // [secondImage drawInRect : CGRectMake (0, 0, 110, 300)]; [thirdImage drawInRect : CGRectMake (0, 0, 110, 300)]; //www // [4 번째 이미지 drawInRect : CGRectMake (0,0, fourthImage.size.width, fourthImage.size.height)]; UIImage * newImage = UIGraphicsGetImageFromCurrentImageContext(); – chavo218

+0

편집 된 코드를 확인하십시오 – Romance

+0

UIImage에 변형 속성이 없습니다. 다시 확인하십시오. – chavo218

관련 문제