Maui why does my image.png not show up

Eduard Kaufmann 311 Reputation points
2023-07-30T19:04:14.56+00:00

Hi,

I must have a blackout!

in 'VARHauteDetailPage.xaml' I have:
Source="{Binding VARHaute.Image}"
Image being a .jpg file shows correctly
Image being a .png file is NOT showing

are there restrictions in maui .jpg vs .png ( the icons are also .png's)

PS: code can be seen in: https://github.com/edikaufmann/RandoGIT, based on 'Shell mixed Navigation

thank you for resolving my blackout

ed

Developer technologies | .NET | .NET MAUI
Developer technologies | Visual Studio | Other
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2023-07-31T06:52:42.0633333+00:00

    Hello,

    png file could display normally in the MAUI.

    This issue is related to images in the subfolder of Image folder.

    You can show it by opening your Randoff.csproj file, then find the <!-- Images -->, add following code, reopen your VS and rebuild your project, check all images' value of build action property is MauiImage. Then you can see these images normally.

       <!-- Images -->
            <MauiImage Include="Resources\Images\*" />
            <MauiImage Include="Resources\Images\base\*" />
            <MauiImage Include="Resources\Images\Profil\*" />
    

    Please

    Best Regards,

    Leon Lu


    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.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.