The correct scale of taken photo and overlay image in IOS 4 on iPhone 4?
I am making a Camera application with overlay frame. That's what I did:
- All navigation bar, tool bar and control buttons are hidden
- The 开发者_开发技巧preview rectangle is rescaled with the function self.cameraViewTransform = CGAffineTransformScale(self.cameraViewTransform, 1, 1.24299);
- The preview is set to Full Screen (640 x 960) with the above transformation
- Overlay Frame (320 x 480) is set in ImagePickerController's cameraOverlayView property
After picture is taken, here is what I did: - Resize and draw the taken image (1936 x 2592) to 640 x 960 in currentContext - Draw the overlay frame (320 x 480) to that 640 x 960 currentContext
But I found that: - scale is not that right - the frame appeared moved towards the top edge for about 2x pixels
Is there any hint/solution about this issue ?
1936x2592 gives you aspect ratio of 0.74
640x960 gives you aspect ratio of 0.66
640x856 (320x428) would be the correct image size to preserve aspect ratio.
hope it helps...
精彩评论