您是否可以在不使用UIImageView
上的变换的情况下旋转UIImage
?我正在将UIImage
用作地图上的自定义图钉,如果可能的话,希望能够旋转它。
是的,您可以在预定义的图像方向中旋转UIImage:
UIImage *rotatedImage = [UIImage imageWithCGImage:imageObject.CGImage scale:imageObject.scale orientation:UIImageOrientationUp];
这里的方向是预定义的枚举变量:
UIImageOrientationUp,
UIImageOrientationUpMirrored
UIImageOrientationDown
UIImageOrientationDownMirrored
UIImageOrientationLeft
UIImageOrientationRight etc
它可以旋转UIImage。