I have a layout where the top part is used to display some data (eg. simple UI widgets) and the bottom part has a SurfaceView
where I display a CameraPreview
.
In order for this SurfaceView
to extend the whole width of the screen and at the same time maintain a correct aspect ratio, the SurfaceView
actually goes offscreen which is fine since I actually want the app to be divided evenly between the top part and the bottom part.
The problem is that I now want to retrieve only the visible part of the SurfaceView
(ideally as a bitmap) but if I try to do it by setting a PictureCallBack
, the aspect ratios of the picture data returned are just not quite the same as the ones shown in the SurfaceView (I've tried with all of the available getSupportedPictureSizes
).
Any ideas how to tackle this problem? I've attached an image which better illustrates this problem.