scale image of size 1600*1200

2019-08-28 21:39发布

问题:

I am developing image size based iphone application. selecting two photos of size 1600*1200 from photo library and merging of both to single image and save to same library. Again if i check the image size it shows 600* 800. How to get original size(1600*1200) of created New photo(600*800).

Thanks in advance.

回答1:

Check the UIImagePickerControllerDelegate Protocol Reference. The info NSDictionary of the imagePickerController:didFinishPickingMediaWithInfo: method contains the original image.



回答2:

Solved as follows.

UIView *bgView = [[UIView alloc] initwithFrame:CGRectMake(0,0,1600,1200)];
UIGraphicsBeginImageContext(tempView.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage,self,nil,nil);

Thanks for all your support to solve the issue.