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?
我正在使用Visual Studio图标库(VS2008ImageLibrary),有一些粉红色背景的BMP文件。如何让粉红色的背景变得透明?我可以用什么软件来做这件事?有免费的吗?
Thanks
5 个解决方案
#1
1
You can try it online provided you can transform your bmp into a gif first.
如果您可以先将bmp转换为gif,您可以在线试用。
Or you can grab PAINT.Net (freeware), and apply a transparent background by following this video instructions.
或者您可以通过遵循此视频说明获取PAINT.Net(免费软件),并应用透明背景。
#2
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.
我使用了IrfanView的批量转换工具。它仍然是一些工作,因为您必须单击每个图标上的粉红色区域,而不是仅将粉红色指定为透明色,但它有效。使用GDI +写一个简单的转换工具会很容易,我也考虑过。
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
1
You can do it by using ImageMagick convert:
您可以使用ImageMagick转换来完成:
convert input.png -transparent magenta output.png
By the way, it is not pink, its magenta colour.
顺便说一句,它不是粉红色,它的品红色。
#4
0
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:
虽然我不知道你的问题的现代.NET答案,但值得注意这些具有洋红色背景的位图的历史原因:
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.
回到仅限Win32的日子,有一些公共控件(如工具栏和ListView)将这些位图和颜色视为透明,然后将该颜色渲染为透明。我想,在幕后,他们使用了像TransparentBtl这样的功能。
#5
0
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.
我知道它与Form.TransparencyKey有关,但我不知道究竟是什么粉红色,你必须知道确切的RGB /系统或Web颜色。
if you know please share us
如果你知道请分享我们
#1
1
You can try it online provided you can transform your bmp into a gif first.
如果您可以先将bmp转换为gif,您可以在线试用。
Or you can grab PAINT.Net (freeware), and apply a transparent background by following this video instructions.
或者您可以通过遵循此视频说明获取PAINT.Net(免费软件),并应用透明背景。
#2
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.
我使用了IrfanView的批量转换工具。它仍然是一些工作,因为您必须单击每个图标上的粉红色区域,而不是仅将粉红色指定为透明色,但它有效。使用GDI +写一个简单的转换工具会很容易,我也考虑过。
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
1
You can do it by using ImageMagick convert:
您可以使用ImageMagick转换来完成:
convert input.png -transparent magenta output.png
By the way, it is not pink, its magenta colour.
顺便说一句,它不是粉红色,它的品红色。
#4
0
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:
虽然我不知道你的问题的现代.NET答案,但值得注意这些具有洋红色背景的位图的历史原因:
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.
回到仅限Win32的日子,有一些公共控件(如工具栏和ListView)将这些位图和颜色视为透明,然后将该颜色渲染为透明。我想,在幕后,他们使用了像TransparentBtl这样的功能。
#5
0
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.
我知道它与Form.TransparencyKey有关,但我不知道究竟是什么粉红色,你必须知道确切的RGB /系统或Web颜色。
if you know please share us
如果你知道请分享我们