2
votes

I am developing the Xamarin UWP project for an existing Xamarin forms project of mine. My existing project has support to Android and iOS only. Now, i am trying to extend the support to UWP as well.

In Xamarin UWP project what should be the icon sizes that needs to be used in UWP project so that it is compatible in all the devices(mobile, tablet and desktop).?

In Android we have the option of providing the sizes as per the drawable folders and in iOS we can mention the icon with their sizes like 1x, 2x and 3x. Likewise What is the method to add the icon assets used in the Xamarin UWP project.?

I have checked the below link and also tried to generate the icons used in the Visual assets tab in the package manifest file in UWP project but it has not worked. Relevant documentation here.

Anyone please provide me the way to generate or standard sizes of icons used in the Xamarin UWP project?

1

1 Answers

0
votes

UWP has very similar way of specifying image scales. The filename pattern is as follows:

ImageName.scale-XXX.png

Where XXX is the scaling factor of the image. The recommended scales you should provide are 100, 200 and 400, but you can also provide 150 and 125 optionally.

The size of the image should be scaled proportionally, so when your default image is 25 pixels wide at scale 100, it should be 100 pixels wide at 400.

For app icons and assets, this should be done for you easily using Visual Studio. For example, set the medium tile to Assets\Square150x150Logo.png and now in the Assets folder add images like:

  • Assets\Square150x150Logo.scale-150.png
  • Assets\Square150x150Logo.scale-200.png
  • Assets\Square150x150Logo.scale-400.png

Notice that you don't have any image with the exact file name (Assets\Square150x150Logo.scale-150.png), only the "scale" variants. The OS will use the appropriate one as it sees fit.

To see what sizes you need, check the guidelines in Visual Studio:

sizes