gpt4 book ai didi

ios - 如何水平翻转 UIImage?

转载 作者:IT王子 更新时间:2023-10-29 07:28:47 29 4
gpt4 key购买 nike

如何水平翻转UIImage,我在UIImage类引用中找到了UIImageOrientationUpMirrored枚举值,如何利用这个属性来翻转 UIImage

最佳答案

objective-C

UIImage* sourceImage = [UIImage imageNamed:@"whatever.png"];

UIImage* flippedImage = [UIImage imageWithCGImage:sourceImage.CGImage
scale:sourceImage.scale
orientation:UIImageOrientationUpMirrored];

swift

let flippedImage = myImage.withHorizontallyFlippedOrientation()

关于ios - 如何水平翻转 UIImage?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5404706/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com