Kinda made it descale to 1920x1080
This commit is contained in:
parent
548b560582
commit
ed7c6c8358
|
@ -49,6 +49,25 @@ class ViewController: UIViewController, UINavigationControllerDelegate, UIImageP
|
||||||
imagePickerController.dismiss(animated: true, completion: nil)
|
imagePickerController.dismiss(animated: true, completion: nil)
|
||||||
imageView.contentMode = .scaleAspectFit
|
imageView.contentMode = .scaleAspectFit
|
||||||
imageView.image = info[UIImagePickerControllerOriginalImage] as? UIImage
|
imageView.image = info[UIImagePickerControllerOriginalImage] as? UIImage
|
||||||
|
|
||||||
|
let image : UIImage = imageView.image!;
|
||||||
|
var tempImage : UIImage? = nil;
|
||||||
|
let targetSize : CGSize = CGSize(width: 1080, height: 1920);
|
||||||
|
UIGraphicsBeginImageContext(targetSize);
|
||||||
|
|
||||||
|
var thumbnailRect : CGRect = CGRect(x:0, y:0, width:0, height:0);
|
||||||
|
thumbnailRect.origin = CGPoint(x:0.0,y:0.0);
|
||||||
|
thumbnailRect.size.width = targetSize.width;
|
||||||
|
thumbnailRect.size.height = targetSize.height;
|
||||||
|
|
||||||
|
|
||||||
|
image.draw(in: thumbnailRect)
|
||||||
|
tempImage = UIGraphicsGetImageFromCurrentImageContext();
|
||||||
|
|
||||||
|
UIGraphicsEndImageContext();
|
||||||
|
|
||||||
|
imageView.image = tempImage;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func setTextInField(path: String) {
|
func setTextInField(path: String) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user