开发者

Transparency in splash screen

I saw the splash screen of th开发者_高级运维e Corel-Draw 12 application and lost my mind!

What technique do they use? On application start-up they load a transparent image, use windows api or what?

How do they achieve this transparency?


Here is a demo project for both VB.NET & C#.


If you are using winforms with vb.net you can modify the opacity of any form by setting the Form.Opacity property. I am not familiar with the splash screen you are speaking about but it shouldn't be too difficult to achieve a similar effect.


If you're using WPF, set the AllowsTransparancy, WindowStyle and Background attributes on the Window object:

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  AllowsTransparency="True"
  WindowStyle="None"
  Background="Transparent">
  <!-- more -->
</Window>


I am also unfamiliar with this flash screen... but if it slowly fades or something, then I would go with Quintin's answer here. Opacity at a certain percentage will show another form through yours.

If the splash screen is just an image and some of it is see-through and some of it isn't, then you can set the transparency key on your form to a certain color, then set the form's background color equal to that, and then whatever image you wish to display should be loaded into a picture box. Make sure you use a .GIF image though! or some other format that supports deleting out the background. JPG's and BMP's are worthless here since their "empty" color becomes white instead of transparent.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜