Splash screen with transparent image

  • Thread starter Rodger Constandse
  • Start date
R

Rodger Constandse

Hi,

I'm trying to create a splash screen using an image that has transparent parts.
The effect I'm after is similar to the Acrobat Reader splash screen where part
of the image appears to jump off the splash screen rectangle.

I've tried several things but keep running into problems where either the Form's
background is still displayed, or the transparent color in the image becomes
black and does not show as transparent.

What is the best way to show a transparent image only (without any Form
background) for a Windows Forms application?

Thanks,
Rodger
 
B

Bob Powell [MVP]

Use a form with no border and set the forms region property to a region that
displays the irregular shapes. You can use a region with several parts and
an animated portion to create such an effect.

See the GDI+ FAQ on how to extract a region from a bitmap.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
R

Raj Chudasama

Don t use imagelists
load the image using Image.FromFile

Bitmap bit =
(Bitmap)Image.FromFile(Application.StartupPath+"\\"+dir+"\\"+imagenamewithextension);
 
R

Raj Chudasama

The bleeding look occurs b/c there are some bugs in GDI where it does not
draw images that are partially transparent. It either need full transparent
or not at all transparent images in order to draw them. This is especially
the case with imagelists. therefore do not use the imagelist if you have
transparent images.

The dark blue or black around the images are b/c of this bug. so use a
picture box. load images as follows. change images in the image box as
needed (this is all if you have transparent images)
 
B

Bob Powell [MVP]

This is more difficult but possible. Your splash screen should be based on
NativeWindow and implement a LayeredWindow scheme. This enables you to
create an image with per-pixel alpha. This effect is seen when you drag a
bunch of files with XP. The semi-transparent file list that you drag is a
per-pixel alpha layered window.

Google for those keywords.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
R

Rodger Constandse

Hi Bob,

Thank you! Your suggestion did exactly what I wanted.

Best regards,

Rodger
 
E

Eric

hi, Bob
I'am looked the NativeWindows, however
I don't have any ideas of that behind the sense
Could you give me some suggests, thanks

Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top