I'm trying to create a splash screen in C# WinForms (not WPF) with a semi-transparent image (32 bit PNG). However, I can't get it to show up properly.
This is the image I am working with (transparency checkerboard just for clarification):
Solutions I tried:
1: Using TransparencyKey
:
This gave an undesired result since the picture also uses partially transparent areas.
2: Overriding OnPaintBackground
:
bool painted = false;
protected override void OnPaintBackground(PaintEventArgs e)
{
if (painted) return;
e.Graphics.DrawImage(BackgroundImage, new Point(0, 0));
painted = true;
}
The usage of the above code (found here) yielded another undesired result as the background was simply black.
Conclusion:
Is there any way to create such a splash screen inside of WinForms?