dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.05k stars 1.73k forks source link

[Android] MauiIcon BaseSize and ForegroundScale doesn't work #7305

Closed janseris closed 2 years ago

janseris commented 2 years ago

Description

There is no way to preserve aspect ratio or to scale the icon inside the icon area. My app icon looks awful due to the fact that it stretches somehow through the icon area (both stretched and cropped when not a square probably).

Simulation of the MauiIcon behavior: Image appicon Result: image

Setting BaseSize and ForegroundScale attributes on MauiIcon does nothing although the behavior is documented in https://docs.microsoft.com/en-us/dotnet/maui/user-interface/images/app-icons

Steps to Reproduce

<MauiIcon Include="Resources\appicon.png" ForegroundFile="Resources\appicon.png" >
    <BaseSize>32,32</BaseSize>
    <ForegroundScale>0.65</ForegroundScale>
</MauiIcon>

Version with bug

Release Candidate 3 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 11

Did you find any workaround?

No response

Relevant log output

No response

VincentBu commented 2 years ago

repro with vs main build(32522.39.main)