Hello,
This error is expected. The process of converting DrawingView to an image stream is actually very complicated, and you cannot directly assign it to an Image by reading the stream. You need to convert it through the API provided by DrawingView.
Please refer to the following documents and code examples.
private async void DrawingView_DrawingLineCompleted(object sender, CommunityToolkit.Maui.Core.DrawingLineCompletedEventArgs e)
{
var imgstream = await DrawingView.GetImageStream(desiredWidth: 400, desiredHeight: 300, imageOutputOption: DrawingViewOutputOption.FullCanvas);
test_img.Source = ImageSource.FromStream(() => imgstream);
}
Best Regards,
Alec Liu.
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.