简体   繁体   中英

Android Camera Preview not Full Screen

I am developing a camera app but the camera is not full screen. I am using common "CameraPreview" class to open camera. it includes Surfaceview and Determining Optimal Size for camera. In tablet and phones, camera is not full screen. For example, tablet size is 1280x728 but camera size is 1024x768. It is shown in FrameLayout for which layout widht and height is FillParent. I could not understand and solve this issue. I wanna open camera in full screen without stretching.

Is there anybody got this issue and fix it?

Judging by the code here :(which you can use actually), you can use the method getSupportedPreviewSizes() and see what are the supported resolutions, 1024x768 could easily be the highest one available for this preview and as you found out, it is really the highest supported.

So those are the supported resolutions, there's no way you can get higher than the supported. You must find a workaround for this, like to put the preview in the center and surrond it with black frame or something like that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM