views:

1922

answers:

4

I'm using Visual Studio icon library (VS2008ImageLibrary), there are some BMP files with a pink background. How can I make the pink background become transparent? What software can I use to do this? Any free one?

Thanks

+2  A: 

I used IrfanView's batch conversion tool. It's still some work, because you have to click the pink area on every single icon instead of just specifying pink as transparent color, but it worked. It would be easy to write a simple conversion tool using GDI+ though, which I considered as well.

Note that even though you can use them then as transparent images, many of them unfortunately still have ugly edges when you render them on a dark background or use them as overlay. If you just want very few of them, consider tweaking them individually if you think you'll not always have a bright background.

OregonGhost
As said in the comment of my question, +1 for your batch suggestion
VonC
Thanks. It's still not great with this approach, but it took only two minutes to convert the VSObject_* icons with it, so no need to put too much work in this one-time job :) As a side-note, things like this are also quite easy with IrfanView for single images, not just for batch conversion.
OregonGhost
A: 

You can try it online provided you can transform your bmp into a gif first.

Or you can grab PAINT.Net (freeware), and apply a transparent background by following this video instructions.

VonC
You don't really want to do that with several hundred icons manually.
OregonGhost
Nope, I don't want to do that. But then again, that was not exactly the question. Still, +1 for your batch suggestion.
VonC
A: 

While I don't know the modern .NET answer to your question, it's worth noting the historical reason for these bitmaps with magenta backgrounds:

Back in the Win32-only days, there were some Common Controls (like the Toolbar, and ListView) that took these bitmaps and a colour to be treated as transparent, and then rendered that colour as transparent. I imagine that, behind the scenes, they used functions like TransparentBtl.

Martin Kenny
Actually, I see support for that concept even today in many libraries, even though it should be fading away because of alpha transparency support being everywhere.
OregonGhost
A: 

I know it's something related to Form.TransparencyKey but I donno what is exactly that pink, you have to know the exact RGB / system or Web color.

if you know please share us

Color.Magenta however the transparency looks bad when you do this as you can still see the outline of where the pink bit was
Trotts