I am looking for application toolbar icons in bmp format. I am looking for a collection that has a truly transparent background. Many of the icons have a red or white background...this does not work well for the current application.
You don't need to worry about the transparency of the icons. Visual Basic will take care of this.
Stick to the same bitmaps having white or red backgound and insert them in your image list.
On the 'General' tab of the image list property pages, make sure that the 'UseMaskColor' check box is selected.
Now click the 'Color' tab and select 'MaskColor' from the 'Properties' list on the left.
From the 'Color Set' combo on the right, choose 'Standard Colors' and then White or Red color from the 'Color Palette' list on the bottom (whichever background color your icon bitmaps have).
Click OK. After these steps, Visual Basic will automatically mask the selected color and icons will appear transparent as required.
Thank. Now I understand how to use the mask feature.
That procedure did work fine. It seems some of my icon
backgrounds are gray and white. I assume I must find a
set of icons with a common background color.
I like to use the same background color as the default microsoft toolbar bitmaps fornd in C:\Program Files\Microsoft Visual Studio\Common\Graphics\Bitmaps\TlBr_W95. It just keeps things consistant and the image list mask is already set to that colour.
I have some pictures/icons on top of varying BackColor and I can't seem to get the masking to work. I have tried pure white, gray and magenta in both the images and the control. The whole rectangular image is shown with white/gray/magenta border/BackColor...
My current approach is keeping the images in an ImageList with correct MaskColor and pic.Picture = smallIcons.ImageList(i).Picture
Argh! Any suggestions to work-arounds? I do need to display several images on the GUI and the BackColor is subject to change. I do not want to make copies of the image file and change the color there but... if that's the only way...
I went with the ImageList.ListImages().Draw method and got it to work. I had to put it in the Paint event of the control with the DC. Thanks for the help guys!
Another problem... when I change state I want to change icon on the DC but it is transparent. How do I clear a certain area before I draw another icon?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.