2010-11-04 116 views
5

您是否可以在不使用換算關係UIImageView的情況下旋轉UIImage。我正在使用UIImage作爲地圖上的自定義別針,如果可能,我想旋轉它?旋轉UIImage?

回答

3

編號可能能夠做的唯一的事情就是設置UIImageOrientation以使操作系統在您的基礎上爲您旋轉 - 儘管這隻會給您四個(主)90-度旋轉。

+0

但是UIImage :: imageOrientation是隻讀的! – Martin 2012-07-13 10:17:50

0

耶士可以在預定義的ImageOrientations旋轉和的UIImage:

的UIImage * rotatedImage = [UIImage的imageWithCGImage:imageObject.CGImage規模:imageObject.scale取向:UIImageOrientationUp];

這裏取向是預定義枚舉變量:

UIImageOrientationUp, 
UIImageOrientationUpMirrored 
UIImageOrientationDown 
UIImageOrientationDownMirrored 
UIImageOrientationLeft 
UIImageOrientationRight etc 

它旋轉的UIImage。