How do I mirror a UIImage picture from UIImagePickerController

后端 未结 6 1764
后悔当初
后悔当初 2021-02-12 22:27

I\'m trying to figure out if there is any way to mirror an image. For example, take a picture of someone\'s face and then cut it in half and show what their face looks like with

6条回答
  •  孤独总比滥情好
    2021-02-12 22:42

    You can use below code for Swift 4.0

     func didTakePicture(_ real_image: UIImage) {
       //suppose real_image = :)
     var flipped_image = UIImage(CGImage: real_image.CGImage!, scale: real_image.scale, orientation: .leftMirrored)
      // flipped_image is  (:
      }
    

提交回复
热议问题