美文网首页
iOS 图片镜像翻转

iOS 图片镜像翻转

作者: 王家小雷 | 来源:发表于2020-12-01 18:56 被阅读0次

    UIImage *backImage = [UIImage imageNamed:@"图片名字"];

    //改变该图片的方向
    backImage = [UIImage imageWithCGImage:backImage.CGImage
    scale:backImage.scale
    orientation:UIImageOrientationDown];
    以下是图片方向的选择(添加了一些个人理解):

    UIImageOrientationUp, // 默认方向
    UIImageOrientationDown, // 让默认方向旋转180度
    UIImageOrientationLeft, // 让默认方向逆时针旋转90度
    UIImageOrientationRight, // 让默认方向顺时针旋转90度
    UIImageOrientationUpMirrored, // 默认方向的竖线镜像
    //(即以原图的左(或右)边的竖线为对称轴,对原图进行对称投影得到的镜像)
    UIImageOrientationDownMirrored, // 让镜像旋转180度
    UIImageOrientationLeftMirrored, // 让镜像逆时针旋转90度
    UIImageOrientationRightMirrored, // 让镜像顺时针旋转90度

    相关文章

      网友评论

          本文标题:iOS 图片镜像翻转

          本文链接:https://www.haomeiwen.com/subject/xnaswktx.html