Recommended Format: PNG
If you have recently upgraded to Visual Studio 2005 count yourself lucky. Implementing
high-quality 32-bit icons couldn't be easier. The new feature of interest is full
support of PNG format. This means that you can implement 32-bit color icons with
no transparency issues, no mask colors, and no hassles.
This article focuses on Visual Studio 2005's Toolstrip control, which can be used for implementing
toolbars and/or other navigation. It should go without saying that
these instructions will work equally well for both Visual Basic and C#.
1. Start up VS 2005 and create a blank desktop application.
2. Add the Toolstrip Control to the form.
3. Set the ImageScalingSize to match the resolution (size) of the icons you wish to
use. This property can be found on the items collection editor dialog or on the
default Toolstrip properties dialog.
Important Note:
Do not try to automatically scale the images by setting the ImageScalingSize
smaller
than the source image. The scaled quality will not be the same, so you will
want to use smaller source images instead. All of our collections are divided by
resolution, so it should be fairly easy to isolate the images you need.
4. Add buttons to the toolbar using the Add Button (see above screenshot).
For the source images you will want to use PNG format.
5. By default the control will support 32-bit color so there will be no need
to specific this.
If you are using other controls which require the use of the ImageList control,
you will need to manually change the color depth to 32-bit.
View a Screenshot
That's all there is to it. Here is the end result:
The icons in this example can be found in our
Software Icons
Collection.