Ivo6070

Hi

I'm trying to add a bitmap (24-bit) to my tool window with SetTabPicture in Visual Studio 2005. However no matter what I do the image I get is converted to 16 color using the system palette. I tried passing the HBITMAP as a VT_INT variant, I tried LoadBitmap and LoadImage with different options, I tried creating a IPictureDisp first, all with the same result. When I use the same bitmap as a menu or toolbar image it shows up in full color.

I also tried the CPPToolWindow sample, and it has the same problem. The source image is 256 color, but the one I see at runtime is 16 color.

Any ideas

BTW, according to the docs the background must be (0,255,0) green, but I found that this doesn't work. Either of this works fine - (0,254,0) green or (255,0,255) purple. The CPPToolWindow sample itself uses purple background.

Ivo

P.S. I'm running Visual Studio 2005 on Windows 2000


Re: Visual Studio Extensibility SetTabPicture

Will Ballard

I can verify that I get the same results, so this isn't just you Smile



Re: Visual Studio Extensibility SetTabPicture

Carlos Quintero - MVP

It seems that we will be plagued with this kind of background/palette errors until MS finally decides to switch to icons and not bitmaps. The same story for 10 years so far...

In VS.NET 2002/2003 you have to use almost green (0,254,0) for background pictures when calling SetTabPicture.

In VS 2005 you have to use magenta background (255,0,255). See https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx FeedbackID=113954

Guess what In VS 2008 you have to use almost green again...

Then you have to use TrueColor 24-bits.

Then, you need to ensure that you set the tab picture BEFORE making the toolwindow visible.

And finally you have also this other bug:

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx FeedbackID=113955






Re: Visual Studio Extensibility SetTabPicture

Ivo

Thanks, Carlos, for the comprehensive explanation. Do you know if this is fixed in Orcas

Ivo





Re: Visual Studio Extensibility SetTabPicture

Carlos Quintero - MVP

VS 2008 uses again almost green 0,254,0 and not magenta.

About the final bug that I mentioned, according to the bug report:

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx FeedbackID=113955

they fixed it, but I didn't verify it.






Re: Visual Studio Extensibility SetTabPicture

Ivo

It seems to be working fine in VS 2008 Beta2. Thanks.