Hi,
I am using the .NET toolbar with VB.NET 2003.
My toolbar uses icons images that are actually PNG files and uses alpha
blending on it. So to make alpha blending work correctly with the Toolbar
and the Imagelist I had to use a tricky method with API calls that is
described like this by a MS MVP :
1) Use v6 of the common controls (have a manifest)
2) Load the PNG using GDI+
3) Create a 32bpp DIBSection (interop with Win32 GDI)
4) LockBitmap() on your GDI+ Bitmap
5) memcpy() the image bits to the 32bpp DIBSection
6) Use ImageList_Add() (Win32) to add the DIBsection to the ImageList
Using the method, the icons with alpha blending appears great on the
toolbar. The problem now is when is set Toolbar1.Buttons(0).Enabled = False,
instead graying out the image as if it was disabled, the buttons becomes
completely dark gray.
I tried to set Imagelist.TransparentColor = Color.Transparent, but it didn't
help.
By the way my Imagelist.ColorDepth is 32 bits
--
Philippe Meunier
Programmer
CHCA Computer Systems Inc.
|