Jeffrey Chen
Jeffrey Chen

Reputation: 77

How to customize a window to take a photo

For an android phone.

In .net MAUI, I want to customize a window with a "Take Photo" button, once this button is clicked I want to take a photo.

I know in Xamarin, I can install package Xam.Plugin.Media and then call Plugin.Media.CrossMedia.Current.TakePhotoAsync method to take a photo but I don't know how to do it in MAUI. I don't know if I need to install any packages for MAUI.

I know in MAUI, I can use Microsoft.Maui.Essentials and call MediaPicker.CapturePhotoAsync() to take a photo, but this method calls the default Camera app of the mobile device.

Upvotes: 1

Views: 2203

Answers (1)

Gerald Versluis
Gerald Versluis

Reputation: 34083

You can either go and implement your own wrapper for a camera control which, especially for Android, is not really a fun task.

So the other option is to look at the Xamarin Community Toolkit which has a CameraView. At the time of writing we don't yet have our .NET MAUI package ready, but we're working hard on it and should have the first previews this month.

Upvotes: 3

Related Questions