Home > Net >  Xamarin transparent background image not showing as transparent (Grey and white)
Xamarin transparent background image not showing as transparent (Grey and white)

Time:08-08

I am new to xamarin forms. I am trying to display an image with "Transparent background" (Grey and white) but this is how it show on the application.
I am using PNG file for the picture as I saw the other thread commenting on PNG/JPG files but it did not work.
I also try with opacity and backgroundcolor="Transparent" but it did not work either.
The image is random transparent background image got from google.
Any help is appreciated! Thanks.

Picture of the application

<StackLayout BackgroundColor="OrangeRed">
    <Image Source="icon11.png" Aspect="AspectFit" />
</StackLayout>

CodePudding user response:

As Shaw mentioned in the comment, I made a blunder on the transparent background PNG files.
I tested with a transparent background xamarin logo from pre-built xamarin form pages and it worked.
Conclusion for my case: Double check if the picture actually has transparent background.

Detail Info:
The picture I used and shown above does not actually have transparent background, one can check when open it from your PC (It will shows the white and grey boxes).
Not "Real" Transparent Picture
Actual Transparent Picture

  • Related