亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何水平翻轉UIImage?

如何水平翻轉UIImage?

iOS
慕斯王 2019-12-18 16:36:27
如何UIImage水平翻轉,我UIImageOrientationUpMirrored在UIImage類引用中找到了枚舉值,如何利用此屬性翻轉UIImage。
查看完整描述

3 回答

?
呼啦一陣風

TA貢獻1802條經驗 獲得超6個贊

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


UIImage* flippedImage = [UIImage imageWithCGImage:sourceImage.CGImage 

                                            scale:sourceImage.scale

                                      orientation:UIImageOrientationUpMirrored];


查看完整回答
反對 回復 2019-12-18
?
慕尼黑的夜晚無繁華

TA貢獻1864條經驗 獲得超6個贊

您可以通過創建UIImageView而不是UIImage并在UIImageView上進行轉換來實現此目的。


yourImageView.image =[UIImage imageNamed:@"whatever.png"];

yourImageView.transform = CGAffineTransform(scaleX: -1, y: 1); //Flipped

希望這可以幫助。


查看完整回答
反對 回復 2019-12-18
  • 3 回答
  • 0 關注
  • 722 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號