Android - image differs from preview

I have a camera application, in it the simplest state is nothing more than an example of cameraPreview with some "takePicture" code. The link is an online example on 2.0, and I am developing against 1.5 (API lvl 3), but still here: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics /CameraPreview.html

The biggest difference with the old version is the whole thing getOptimalPreviewSize. Everything is done by landscape.

Now the problem is that I have a preview, but when I take a picture, there is more information about this image, and then on the preview. The top and bottom display items that were not visible in the preview.

Now I'm going to overlay the preview to align the object in the picture with something. If the picture is taken, it all shrinks a bit, and I'm uneven: (.

The camera application on the system does not have this problem, so you need to fix it. Any thoughts?

If I have to manually set the size of the preview and / or image, I will have problems with different phones, I think, and because there are many functions only with the lvl 5 API (for example: getOptimalPreviewSize), I can not use them.

+3
source share
2 answers

Android Android, , . Android 1.5 1,1% Android 10/29/2011. , , API 5. , .

getSupportedPreviewSizes() getSupportedPicturesSizes(). , ( /). , . , .

: , , . .

1.5 Android

+4

, getSupportedPicturSizes, . , Camera, . , , (/ /)

+1

Source: https://habr.com/ru/post/1755331/


All Articles