+ (UIImage *)imageWithCGImage:(CGImageRef)cgImage scale:(CGFloat)scale orientation:(UIImageOrientation)orientation
作用:对UIImage进行放大旋转
参数1: cgImage = image.CGImage image为原始图片
参数2:scale 原始图片放大倍数
参数3:orientation 即UIImage的imageOrientation属性 控制image的绘制方向
typedef NS_ENUM(NSInteger, UIImageOrientation) {
UIImageOrientationUp, // default orientation
UIImageOrientationDown, // 180 deg rotation
UIImageOrientationLeft, // 90 deg CCW
UIImageOrientationRight, // 90 deg CW
UIImageOrientationUpMirrored, // as above but image mirrored along other axis.
horizontal flip
UIImageOrientationDownMirrored, // horizontal flip
UIImageOrientationLeftMirrored, // vertical flip
UIImageOrientationRightMirrored, // vertical flip
};
本文介绍了一个用于UIImage的自定义方法,该方法可以实现图片的放大与旋转功能。通过CGImageRef、放大倍数及方向参数,开发者能够灵活地调整图片的显示效果。
3820

被折叠的 条评论
为什么被折叠?



