Insert Icons

Images are usually contained inside the workbook file
Click the Insert Icons button
The icon will be displayed in a pane on the right and will be given a default ID
This ID can be changed by right clicking
In the file the images are saved in the following folder: CustomUI\images
and also creates a customUI.xml.rels file in the customUI\_rels folder to relate the Ids to the actual image files.

In the XML file < getimage = "GetImage" />

public System.Drawing.Bitmap GetImage (Office.IRibbonControl control) 
   return new System.Drawing.Bitmap (Properties.Resources.MyIcon);

The image attribute is used when you want to provide a custom image for your controls
For document-level solutions these are usually contained inside the actual document.
The Ribbon drawing engine is designed to work with full-colour (24 bit) images that also have an alpha channel for pixel transparency
The Office 2007 Custom UI Editor can be used to add custom images to document files
Just click on Insert Icons and select the file to add
A default ID is provided but can be changed by right clicking on the icon.

When Excel loads a workbook, it calls the loadimage callback for every image attribute it finds that doesn't point to an image contained within the file, passing the value of the image attribute as the imageID.

loadPicture does not handle the png file format

© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited TopPrevNext