圖片旋轉(zhuǎn)
UIImage *backImage = [UIImage imageNamed:@"圖片名字"];
//改變該圖片的方向
backImage = [UIImage imageWithCGImage:backImage.CGImage
scale:backImage.scale
orientation:UIImageOrientationDown];
以下是圖片方向的選擇
UIImageOrientationUp, // 默認(rèn)方向
UIImageOrientationDown, // 讓默認(rèn)方向旋轉(zhuǎn)180度
UIImageOrientationLeft, // 讓默認(rèn)方向逆時針旋轉(zhuǎn)90度
UIImageOrientationRight, // 讓默認(rèn)方向順時針旋轉(zhuǎn)90度
UIImageOrientationUpMirrored, // 默認(rèn)方向的豎線鏡像
//(即以原圖的左(或右)邊的豎線為對稱軸崩溪,對原圖進(jìn)行對稱投影得到的鏡像)
UIImageOrientationDownMirrored, // 讓鏡像旋轉(zhuǎn)180度
UIImageOrientationLeftMirrored, // 讓鏡像逆時針旋轉(zhuǎn)90度
UIImageOrientationRightMirrored, // 讓鏡像順時針旋轉(zhuǎn)90度
view旋轉(zhuǎn)
水平翻轉(zhuǎn)
view.transform = CGAffineTransformScale(imageView.transform, -1.0, 1.0);
豎直翻轉(zhuǎn)
view.transform = CGAffineTransformScale(imageView.transform, 1.0, -1.0);