Problem Using Icon with Clear Background

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm creating an Outlook 2007 addin using VSTO and I'm trying to use an icon
as the image on CommandBarButton objects. My icon is of a circle that has a
clear background, but it doesn't seem to work. When I try to use the
PictureDispConverter class that is used in many of the examples, the icon is
converted, but I get a COM error when assigning it to
CommandBarButton.Picture saying that the value is outside the expected range.


If I try to convert the to a bitmap, I loose the clear background.

Does anyone know why my converted icon wouldn't be working, or have any
suggestions of how to create/use my clear background icon?

Thanks,
Jared
 
Use a PNG file with its full transparency layer. I've had best results using
that format. Second choice is a BMP with transparency. Icons don't have a
transparent layer.
 
I've tried using both PNG and GIF with transparency, but Outlook always
draws them with a dark blue background when in a CommandBarButton. Do you
know if there is a setting that makes it draw that dark blue background?

Thanks,
Jared
 
Sorry, I didn't notice that was for a command bar button. For that you need
2 separate images, one of the main image and the other the mask for the
transparency. You assign the main image as an IPictureDisp object to
button.Picture and the mask in the same format to button.Mask.
 
That explains it.

Thanks!

Ken Slovak - said:
Sorry, I didn't notice that was for a command bar button. For that you need
2 separate images, one of the main image and the other the mask for the
transparency. You assign the main image as an IPictureDisp object to
button.Picture and the mask in the same format to button.Mask.
 
Back
Top