CameraX Customization: PreviewView, Size & Resolution
Nathan Sokalski
4,111
Reputation points
I am trying to figure out how to customize the CameraX
components of my app. I have figured out how to display the preview using the PreviewView
view & take a picture, but I am trying to figure out how to do the following:
- Make the
PreviewView
use the remaining area of the screen. I have tried usinglayout_rowWeight
, but that does not seem to work. I have also tried using things likelayout_gravity="Fill"
, but with no success. - Make the size of the picture taken match the size of the
PreviewView
. Everything that is visible in thePreviewView
MUST be included in the picture that is taken. - Use the maximum resolution. The picture from the camera is not being saved to storage (it is temporary), so file size is not a concern.
If the available sizes are restricted to predefined values, I can deal with that by manually calculating which one will use the maximum amount of the PreviewView
. To sum it up, I need to use the maximum amount of space at the maximum resolution. Any ideas? Are there any good tutorials on how to do these things? Thanks.
Developer technologies .NET Xamarin
5,380 questions
Sign in to answer