Reputation: 555
I'm using UIImagePickerController class to capture image from camera.
When is captured, I save the picture on disk. After that I use imageWithContentsOfFile method to load this image as background of the main screen.
The problem is that when I load the picture appears 2 white bands on top & bottom of the view.
My question is how can I take a picture with 320X480px of size in order to load it full screen?
Thanks.
--EDIT--
The originalImage when is captured sizes this:
INFO -> Captured Image Size W:480.000000 H:640.000000
How can I get the image directly 320X480px?
Thanks.
Upvotes: 0
Views: 923
Reputation: 34912
Presumably you get white bands because you've got the content mode of the UIImageView
you're displaying it in set to UIViewContentModeAspectFit
which means resize the image, maintaining aspect so that it you can see the entire image. If you set the content mode to UIViewContentModeAspectFill
it'll do what you want.
The reason for this discrepancy is that the aspect ratio of the screen (2:3) is not the same as the aspect ratio of the images that come from the camera (3:4).
Upvotes: 1