Merge branch 'SaveWorking' into 'master'

Kinda made it descale to 1920x1080

See merge request !5
This commit is contained in:
Alexander Munch-Hansen 2017-08-07 19:59:47 +00:00
commit 914e2a53b6
1 changed files with 19 additions and 0 deletions

View File

@ -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) {