Bookmark and Share

32-bit Bitmap

If you're creating toolbars and menus for Visual Studio, the only way to get a crisp icon for the item is to use a 32-bit bitmap, which is a 24-bit bitmap plus an 8-bit alpha channel. Unlike lower bit levels, 32-bit bitmaps support transparency which prevent your icons from looking like a box. Worse still, I discovered that using 24-bit bitmaps creates artifacts in the form of little black dots when rendered.

Unfortunately, unless you have a license to Photoshop, you may discover that none of your tools create 32-bit bitmaps. I don't have a Photoshop license at work so I use Paint.NET to do my graphical work (which is great in most of my scenarios). Here's what the Paint.NET author had to say about why 32-bit bitmaps aren't supported: "GDI+ just refuses to cooperate in allowing me to do that."

Luckily, I found a free tool, AlphaConv, that will convert png files to 32-bit bmp files. My process is as follows.

1) Create a png in Paint.NET with 32-bit Bit Depth.

2) Drag and drop the png into AlphaConv with Target format set to .bmp.

3) Copy the resulting bmp file to my project directory, compile my application.

blog comments powered by Disqus

KodefuGuru.GetInfo()

Chris Eargle
LinkedIn Twitter Technorati Facebook

Chris Eargle
Telerik Developer Evangelist, C# MVP

JustCode

Telerik .NET Ninja

 

INETA Community Speakers Program

 

MVP - Visual C#

 

Friend of RedGate

World Map

Tag cloud

Month List

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer’s view in any way.