PNG of course

Nov 29, 2006 14:10 GMT  ·  By

After you have familiarized yourself with the process of writing add-ins for the graphical user interface in the 2007 Microsoft Office System, and created icons using RGB images plus an alpha channel to resolve the transparency, a question might come to mind. What image format shoud you choose for the image? Well this one is in fact pretty simple. JPEG is no choice at all, BMP technically supports transparency, but the general problems associated with library loading simply don't recommend it.

GIF is a viable option. But you have to keep in mind that it supports only single level transparency. Which translates into the impossibility to implement levels of visibility. The GIF format in fact is not known for its flexibility. Additionally, GIF is designed for continuous tone colors, so color effects might not display properly.

Microsoft's own recommendation for storing RibbonX images is PNG. It is common, supports alpha channels and it has widespread tool support. ?RibbonX operates on bitmap objects in code, not on files on the disk. It's the add-in which actually loads the files and returns the bitmap objects to RibbonX. Thus, an add-in can use whatever file format it wants when it is loading its images,? reveals Eric Faller, Software Design Engineer on the Office User Experience Team.

So, in fact, the actual question is not related to RibbonX, but to the libraries you will use. And in this case, Faller also provides an answer: ?GDI+ can be used from both native C++ code as well as managed C#/VB.NET code and it supports loading all common file formats, so it's the recommended library to use to load images.?

There is also the problem of 16-bit over 32-bit. But this one is quite simple. PNG 32-bit. 8 bits for each channel: red, green, blue and alpha.