1
@IBAction func mirrorBtn(sender: AnyObject){
self.makeMirroredImage(imageView)
pickImage.image = imageView
}
func makeMirroredImage(image: UIImage) -> UIImage {
var flippedOrientation: UIImageOrientation = .UpMirrored
switch image.imageOrientation {
case .Down:
flippedOrientation = .DownMirrored
case .Left:
flippedOrientation = .LeftMirrored
default :
flippedOrientation = .LeftMirrored
}
let flippedImage: UIImage = UIImage(CGImage: image.CGImage!, scale: image.scale, orientation: flippedOrientation)
return flippedImage
}
你能提供一些你已經試過的代碼嗎? – Asdrubal
@Asdrubal我有我的鏡像功能。它不工作 – nandinibm
你的意思是這樣的嗎? http://stackoverflow.com/questions/10936590/flip-nsimage-on-both-axes –