I'll show you here how to add them for the folders and use the Mobile Assets as an example, but the views are the same principal.
- Grab an image you want to use and get it sized appropriately, I used a 16 x 16 pixel image, called it mobilephone16x16.png and saved it in the same dir as the MP I was creating.
- Add this XML at the bottom of your MP to reference the file:
<Resources>
<Image ID="Image.MobilePhoneFolder.16x16" Accessibility="Public" FileName="mobilephone16x16.png" HasNullStream="false"/>
</Resources> - Add this XML to the Categories section (after TypeDefinitions and before Presentation):
<Categories>
<Category ID="Category.MobilePhoneFolderImage16x16" Target="Image.MobilePhoneFolder.16x16" Value="System!System.Internal.ManagementPack.Images.u16x16Icon"/>
</Categories> - Add this XML to the ImageReferences section (before StringResources):
<ImageReferences>
<ImageReference ElementID="Folder.Mobiles" ImageID="Image.MobilePhoneFolder.16x16"/>
</ImageReferences> - Use the new-mpbfile.ps1 powershell script to bundle the MP and images together into a MPB file.
Step 1 is find and save you picture in the right size/format
Step 2 is add the section that tells the MP where to find the graphic
Step 3 tells the MP what size and usage etc the image is
Step 4 tells the MP to link the image to the folder (this is where you could point the image at a view instead)
Step 5 bundles the images and MP together into a MPB for importing
3 comments:
Thanks Steve
Great explanation Steve. I'll definitely give this a try later in the week... I'll let you know how the instructions work for me!
This is a really good information. I have found it useful. I did not know that adding custom image was this easy until now.
Post a Comment