having image distorted when mixing a view from OpenGL and the Android camera to get an image of both when using the takepicture method. I checked and found that the camera picture was set to 640X480 and the openGL view and the camera preview was both set to 1280x720.
so I set the camera picture size to 1280x720 and the result was perfect. however I can't set the size in code because each Android device will be different and every device the settings for both preview size and picture size have to be selected from a list of supported sizes.
what is the best way to do this considering that there are three variables here, the screen size of the activity layout, the camera preview size, and the picture size.
is it best to use a match_parent or fitXY for the FrameLayout size and only work with two variables, the preview size and picture size?
notice that several of the width and height combinations in preview sizes and picture sizes are the same. for example 1280 x 720 exists in both preview and picture, is it always the case that there will be matches in both sizes?
List<Size> previewSizes = mCamera.getParameters().getSupportedPreviewSizes();
List<Size> imageSizes = mCamera.getParameters().getSupportedPictureSizes();
// layout in the activity that the cameraView will placed in
int layoutWidth = frameLayout.getWidth();
int layoutHeight = frameLayout.getHeight();
for example in one Android tablet after measurement these are the results for the 3 variables used
size of layout viewGroup in activity as result of measurement
1280 x 736
supported picture sizes
320 x 240
640 x 480
1024 x 768
1280 x 720 << best size in my example to use
1280 x 768
1280 x 920
1600 x 1200
2048 x 1536
2560 x 1440
2560 x 1536
2560 x 1920 << native resolution of hardware camera
supported preview sizes
176 x 144
320 x 240
352 x 288
480 x 320
480 x 368
640 x 480
800 x 480
800 x 600
864 x 480
864 x 576
960 x 540
1280 x 720 << best size in my example to use
1280 x 768
1280 x 960
mCamera
constructed? – Epsomite