Over a million developers have joined DZone.

Use Built-In Application Icon Resources on Windows Phone

· Mobile Zone

Visually compose APIs with easy-to-use tooling. Learn how IBM API Connect provides near-universal access to data and services both on-premises and in the cloud, brought to you in partnership with IBM.

NOTE: I am not sure how this will affect Marketplace certification for your application.

Internally, a lot of images are referenced as resources. For example, the icons you see for stock OS applications are, in fact, local resources that can also be referenced from your own application.

Let’s start with the most basic approach – setting your application icon to be an OS resource. Open the WMAppMaifest.xml and find the IconPath and BackgroundImageURI nodes. If you are reading this blog, I am assuming that you already have the knowledge of what each node represents, but in case you don’t:

  • IconPath – the icon shown in the app list in the secondary screen.
  • BackgroundImageUri – the icon used for the app, if it is pinned to the home screen.

Set the IsResource attribute to true. Now, for the icon path use something like this:

res://StartMenu!AppIconAlarms.png

Your modified node should look like this:

<IconPath IsRelative="true" IsResource="true">res://StartMenu!AppIconAlarms.png</IconPath>

Launch the application. Here is what you will get:

image

So the AppIconsAlarm.png represents the icon from the StartMenu set that is used for the Alarms application. Here is a (incomplete) list of resources that you could use here:

res://StartMenu!AppIconIE.png

image

res://StartMenu!TokenIE.png

image

res://StartMenu!token.xboxlive.png

image

Where are these located? Obviously, in the DLLs that contain resources. In the case above, there is a StarMenu.dll that you can get if you dump the emulator ROM. A quick look at the contents with Resource Hacker gives us a glance at icons that you probably never saw before, like:

res://StartMenu!allapp.games.png

image

Here is a complete list of reusable icons from the StartMenu DLL:

  • allapp.games.png
  • allapp.marketplace.png
  • allapp.office.transformer.png
  • appiconalarms.png
  • appiconcalculator.png
  • appiconcalendar.png
  • appiconcamera.png
  • appicongames.png
  • appicongeneric.png
  • appiconie.png
  • appiconmail.png
  • appiconmaps.png
  • appiconpeople.png
  • appiconphone.png
  • appiconphone_voicemail.png
  • appiconphotos.png
  • appiconsettings.png
  • appiconsms.png
  • appiconzune.png
  • calendar.conflict.24.png
  • calendar.recurring.24.png
  • calendar.reminder.24.png
  • smartdj.47x43.png
  • start.arrownext.rest.png
  • start.groupheader.png
  • start.search.rest.png
  • start.unpin.43.down.png
  • start.unpin.43.rest.png
  • status.notification.circle37.png
  • token.marketplace.png
  • token.office.transformer.png
  • token.xboxlive.background.png
  • token.xboxlive.png
  • token.zune.png
  • tokenalarm.png
  • tokencalculator.png
  • tokencamera.png
  • tokengamesgen.png
  • tokenie.png
  • tokenmaps.png
  • tokenmusicandvideoicon.png
  • tokenphone.png
  • tokenphotos.png
  • tokensettings.png
  • tokensms.png

With a bit more research, you could set the values to be more obscure, like res://accountsettings!error.png or res://accountsettings!warning.png (fair warning – not Metro-compatible here).

There is also ASIcons.dll where you can get icons related to email accounts (e.g. set.dark.exchange.png). FileIcons.dll contains icons that can be used as file format identifiers.

The Mobile Zone is brought to you in partnership with Strongloop and IBM.  Visually compose APIs with easy-to-use tooling. Learn how IBM API Connect provides near-universal access to data and services both on-premises and in the cloud.

Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}