Reputation: 269
I need to set a background image which is transparent and hasn't an opacity of 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.
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.
Upvotes: 1
Views: 250
Reputation: 5723
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. 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.
Upvotes: 2