Merge branch 'SaveWorking' into 'master'
Kinda made it descale to 1920x1080 See merge request !5
This commit is contained in:
commit
914e2a53b6
|
@ -49,6 +49,25 @@ class ViewController: UIViewController, UINavigationControllerDelegate, UIImageP
|
|||
imagePickerController.dismiss(animated: true, completion: nil)
|
||||
imageView.contentMode = .scaleAspectFit
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user