开发者

How to use transparent image as background on transparent winform? [duplicate]

This question already has answers here: Transparent images with C# WinForms 开发者_如何学编程 (6 answers) Closed 9 years ago.

I have a WinForm in C#, I have both BackCOlor and TransparencyKey set to color "Lime". If I compile at this point the form is transparent. Then I added an BackgroundImage with a Lime background (#00ff00), but the Lime on the image is not transparent.

How can I get the background image to have a transparent background too?

The image I used is a .bmp


I'm pretty sure the Lime color in the picture is not identical to Lime you set as TransparencyKey.

Use ColorPicker: http://www.iconico.com/download.aspx?app=ColorPic&type=free

over your picture to see what color code the lime in the picture has: e.g. #XXXXXX. Then put that number in TransparencyKey, don't just use "Lime".


Use an image format that supports transparency such as PNG.


It works for me. Are you sure that the BMP has exactly the same background color as your form, and that it has not been altered some way, perhaps by a reduction in the number of colors or something similar?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜