Maui why does my image.png not show up

Eduard Kaufmann 211 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

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,888 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,231 questions
0 comments No comments
{count} votes

Accepted answer
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 72,251 Reputation points Microsoft Vendor
    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