How to make icon with pink background transparent?

落爺英雄遲暮 提交于 2021-02-19 05:18:29

问题


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


回答1:


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.




回答2:


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.




回答3:


You can do it by using ImageMagick convert:

convert input.png -transparent magenta  output.png

By the way, it is not pink, its magenta colour.




回答4:


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.




回答5:


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



来源:https://stackoverflow.com/questions/236322/how-to-make-icon-with-pink-background-transparent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!