Iphone 旋转图像?

Iphone 旋转图像?,iphone,uiimage,Iphone,Uiimage,您是否可以在不使用UIImageView上的变换的情况下旋转UIImage。我正在使用一个UIImage作为地图上的自定义pin,如果可能的话,我想旋转它?否。你唯一能做的就是设置UIImageOrientation,使操作系统在这个基础上为你旋转它-尽管这只会给你四个(主)90度旋转。是的,您可以按预定义的图像方向旋转和创建图像: UIImage*RotateImage=[UIImage imageWithCGImage:imageObject.CGImage缩放:imageObject.sc

您是否可以在不使用
UIImageView
上的变换的情况下旋转
UIImage
。我正在使用一个
UIImage
作为地图上的自定义pin,如果可能的话,我想旋转它?

否。你唯一能做的就是设置UIImageOrientation,使操作系统在这个基础上为你旋转它-尽管这只会给你四个(主)90度旋转。

是的,您可以按预定义的图像方向旋转和创建图像:

UIImage*RotateImage=[UIImage imageWithCGImage:imageObject.CGImage缩放:imageObject.scale方向:UIImageOrientationUp]

此处方向是预定义的枚举变量:

UIImageOrientationUp,
UIImageOrientationUpMirrored
UIImageOrientationDown
UIImageOrientationDownMirrored
UIImageOrientationLeft
UIImageOrientationRight    etc
它旋转图像