Reputation: 31
I have a 4:3 screen tablet (op3n dott) that has a front and back camera.
If I get the preview sizes with getSupportedPreviewSizes()
the flowing sizes has ben reported:
**Back camera:**
1024*576
720*480
640*480
640*360
352*288
320*240
176*144
**Front camera:**
1280*720
1024*576
640*480
176*144
When i set the 1024*576 size for the back camera and the preview layout is resizded for this size, the picture that is shown in the preview is stretched. If the preview layout is resized to 4:3 aspect ratio, so the picture is streched to 1024*768 the picture is looks ok.
With the front camera and the 1280*720 preview size, the picture in the preview is fine without any trick.
When i try the 640x480 preview size for both camera also the picture is looks fine.
So the conclusion is that the back camera with 1024*576(16:9) preview size is realy a strached 4:3 picture.
I have a friend that has a hp touchPad with similar problem.
My question is how could i know when the preview 16:9 aspect image is realy a 4:3 strached image ? Can i use the 640x480 preview size for 4:3 tablets to fix this issue ?
Upvotes: 3
Views: 2139
Reputation: 21
I find that you have to size your (pre-)view with "measureSpec" constraints while in onMeasure() so that it will appear on the screen without being stretched or squished. You may get empty spaces on one or other side if the available view real estate has a different aspect ratio.
Upvotes: 0