Camera.MAUI: Expanding the Width/Height Causes Blurry Preview & Unwanted Zoom on Recording
09:36 06 Mar 2025

I'm using the Camera.MAUI library in my .NET MAUI application to show a camera preview with some overlay elements (timer and record button). However, I'm facing two issues:

Layout Expansion & Resolution:

When I expand the layout (using a Grid with FillAndExpand settings), the camera preview resolution seems to degrade, it becomes blurry. I need the preview to expand to fill the available space without losing its native resolution.

Recording Behavior:

When I click the record button, the preview suddenly fixes itself (the blur goes away) but the camera view zooms in even more, which is not the desired behavior.

Here is my current XAML code for the layout:


    
        
        

Here is the function called when the camera is loaded:

public CameraPage()
{
    InitializeComponent();
    cameraView.CamerasLoaded += CameraView_CamerasLoaded;
}

private void CameraView_CamerasLoaded(object sender, EventArgs e)
{
    if (cameraView.NumCamerasDetected > 0)
    {
        if (cameraView.NumMicrophonesDetected > 0)
            cameraView.Microphone = cameraView.Microphones.First();
            cameraView.Camera = cameraView.Cameras.First();
            MainThread.BeginInvokeOnMainThread(async () =>
            {
                if (await cameraView.StartCameraAsync() == CameraResult.Success)
                {
                    controlButton.Text = "Start Recording";
                }
            });
    }
}

However, when I use these settings:


The camera works perfectly, no blur or zoom, but the preview container is way too small. How can I expand the camera preview container without destroying the resolution?

android .net maui android-camera maui-community-toolkit