简体   繁体   English

设置透明背景图片

[英]Set transparent background image

I need to set a background image which is transparent and hasn't an opacity of 100%. 我需要设置透明的背景图像,并且不透明度为100%。
It is meant as a "loading screen" when the program starts. 程序启动时,它被称为“加载屏幕”。
I want it to be transparent and I am using a new form which has border style none. 我希望它是透明的,我正在使用没有边框样式的新表格。

I am not searching for this solution: 我不是在寻找这个解决方案:

public Form1()
{
    this.TransparencyKey = Color.Turquoise;
    this.BackColor = Color.Turquoise;
}

because this is just unsatisfactory, because of the less than 100% opacity, that the picture has. 因为由于图片的不透明度小于100%,所以这不能令人满意。
And I neither want to use opacity of the form to solve this, because I am already using it for a kind of "fade in" of the form. 而且我也不希望使用表单的不透明度来解决此问题,因为我已经将其用于表单的“淡入”。

Does anybody know how to do this? 有人知道怎么做这个吗? Maybe there is a much simpler way to do this, that I don't know? 也许有一个更简单的方法来执行此操作,我不知道吗?

Sorry for my bad English. 对不起,我的英语不好。
Greetings. 问候。

This is similar to this question and You can use link in the solution suggested there . 这类似于此问题 ,您可以在此处建议的解决方案中使用链接 It uses 32-bit PNG image and GDI functions. 它使用32位PNG图像和GDI功能。 I haven't downloaded the source code, but in order to implement handling of Win32 calls, You can use pinvoke pages, where You should be able to find information about appropriate functions, for example GetDC , SelectObject or BLENDFUNCTION . 我尚未下载源代码,但是为了实现Win32调用的处理,您可以使用pinvoke页面,您应该可以在其中找到有关适当功能的信息,例如GetDCSelectObjectBLENDFUNCTION

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM