The MAUI GraphicsViewDemos image draw causes iOS app to abort

Randy Clegg 45 Reputation points
2023-03-28T15:34:32.3233333+00:00

The GraphicsViewDemos app found at https://github.com/dotnet/maui-samples/tree/main/6.0/UserInterface/Views/GraphicsViewDemos aborts on iOS when the "Image paint" option is selected.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,832 questions
{count} votes

Accepted answer
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 25,766 Reputation points Microsoft Vendor
    2023-03-29T07:34:58.7333333+00:00

    Hello,

    You selected "Image paint" option, which is for Draw an image feature. You could refer to the official doc and use the following code:

    canvas.DrawImage(image, 10, 10, image.Width, image.Height);// or (image,0,0,240,300) as the sample
    

    This error is related to the canvas.SetFillImage(image.Downsize(100)); method. And it is in ImageExtensions class. If I remove this line, the error will disappear.

    You could report this issue at https://github.com/dotnet/maui-samples/issues, thanks for your collaboration.

    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.

    0 comments No comments

0 additional answers

Sort by: Most helpful