Flip UIImage Along Either Axis

后端 未结 5 1514
余生分开走
余生分开走 2021-01-13 17:05

I\'m trying to create a method which flips a UIImage along the X axis, Y axis, or both. I keep getting close but my transform knowledge isn\'t good enough to get all the way

5条回答
  •  暖寄归人
    2021-01-13 17:45

    Try the following:

    UIImage* myimage = [UIImage imageNamed: @"myimage.png"];
    myimage = [UIImage imageWithCGImage: myimage.CGImage scale: 1.0f orientation: UIImageOrientationUpMirrored];
    

提交回复
热议问题