Mobile Zone is brought to you in partnership with:

Robert is a South African technology specialist with focus on Microsoft technologies. He is very passionate about teaching and sharing and is a Microsoft MVP & Ranger. Robert is a DZone MVB and is not an employee of DZone and has posted 75 posts at DZone. You can read more from them at their website. View Full User Profile

App Development Snack: Windows Store File Type Association Icons

12.03.2012
| 2321 views |
  • submit to reddit

One of the declarations you can have with a Windows Store app is the file type association, which lets file types become associated with your application. This means you can customise the icon for the file type & if the user double clicks an associated file, it will launch the application.

One of the properties of declaration is the logo property which is the icon to use for the file type. Logo is optional and if you do not specify it, or you specify it incorrectly, it uses the applications small icon (i.e. the 30x30) one – which doesn’t look great.

image

The solution to this is to correctly specify the logo, but that isn’t as straight forward as it seems. Firstly you don’t just have a single image you need FOUR icons with different resolutions

  • 16x16
  • 32x32
  • 48x48
  • 256x256

Next you need to name them correctly, the format is <name>.targetsize-<resolution>.<extension>, so for example if we wanted to use MyLogo.png as the file name we would have:

  • MyLogo.targetsize-16.png
  • MyLogo.targetsize-32.png
  • MyLogo.targetsize-48.png
  • MyLogo.targetsize-256.png

Lastly is putting in the correct logo name in the manifest, since you have four icons what do you use? You use the name + extension components. Using the example about we would have MyLogo.png as the name & Windows 8 is smart enough to figure out the resolution, insert the target bit and get the right image for the right resolution!

Published at DZone with permission of Robert Maclean, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)