Search code examples
xamariniconsxamarin.formsuwp

How do I set the icon for my application?


I am creating UWP application. I wanted to know from where I can set app icon image.

To be more precise: Where I should change my image for logo? The preview only shows the 24x24 image as shown below. What are the others sizes for?

Should I change the images for the logo in all dimensions?

enter image description here

AppxMainfest.Xaml

<?xml version="1.0" encoding="utf-8"?>
<Package ...>
  ...
  <Properties>
        <DisplayName>StockDispatchApp.UWP</DisplayName>
        <PublisherDisplayName>pci207</PublisherDisplayName>
        <Logo>Assets\StoreLogo.png</Logo>
    </Properties>
    <Dependencies>
        <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.10240.0" MaxVersionTested="10.0.10586.0" />
    </Dependencies>
    <Resources>
        <Resource Language="EN-US" />
    </Resources>
    <Applications>
        <Application Id="App" Executable="StockDispatchApp.UWP.exe" EntryPoint="StockDispatchApp.UWP.App">
        <uap:VisualElements DisplayName="StockDispatchApp.UWP" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="StockDispatchApp.UWP" BackgroundColor="transparent">
            <uap:LockScreen Notification="" BadgeLogo="Assets\96x96.png" />
            <uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"></uap:DefaultTile>
            <uap:SplashScreen Image="Assets\SplashScreen.png" />
        </uap:VisualElements>
        </Application>
    </Applications>
    <Capabilities>
        <Capability Name="internetClient" />
    </Capabilities>
    ...

Solution

  • The MSDN documentation provides clear description of where each of the images is used. In the bottom you can see Asset size tables tables which contain all the dimensions and their usage.

    As for the Square 44x44 logo, the first five images in the first row are used for different scales in the app list.

    The target images are used for app icons in different places around the system. In their unplated form, they should have transparent background. You can provide just the sizes recommended by the form, but you can also provide more sizes (see the documentation for the complete table).