Hi @JosLuisOrihuelaConde-1829 ,
You said "I want to export a MAUI control to an image", I'm not sure if you want to capture the full app window, if so, Essentials : Screenshot is a good option. Or you just want to capture the control itself or any others behaviors.
Besides, I saw that when you tried to use RenderTargetBitmap
and met this error: the method "RenderAync" need a Microsoft.UI.Xaml.UIElement" but the controls of MAUI are "Microsoft.Maui.Controls".
You could try to find the handle of this MAUI control, and get handler.PlatformView
, which is a native control of type Microsoft.UI.Xaml.UIElement
. After that you can set native control properties, invoke native control methods, and subscribe to native control events and so on.
renderTargetBitmap.RenderAsync(handler.PlatformView, 300, 300);
For more details, refer to Customize .NET MAUI controls with handlers.
Best Regards,
Wenyan Zhang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.