Delphi, splashscreens and transparency


Easy SplashScreen Writing Guide v2 with Transparency by Nullified

download eswgv2 finished

 

1. Download pngcomponents courtesy Martijn Saly

2. Finish the tutorial on the previous page, or download eswgv1 and use the sourcefiles and then add pngimage to Delphi, in the uses clausule of Unit2.pas, which is your splashscreen unit

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, IniFiles, ExtCtrls, pngimage;


3. In the object inspector, change the options of unit2.pas as seen below:

splashing transparency 1 splash screen 2


So make sure Alphablend is true, its value is 255 by default. Change the color of the form2 into clFuchsia, and set TransparentColor to true, and also give that a value of clFuchsia.

4. Create any kind of image, give the parts you want to be transparent a color of #ff00ff which is the rgb value of clFuchsia. Be sure to save this file as an .png image with a transparent color. Add this image to your unit2, compile and run and you should see only the parts of the image that have a different value than the clFuchsia.




5. Your done already! For those who managed to stay awake while reading and who even want to take it to a higher level read on...


splashscreen transparent startsplashscreen step 1transparency step 2


How about a splash that indicates the progress being made? This makes it even more outstanding, and if you want to view how to integrate a progressbar into your splashing screens then click on splashscreen with progress indicator v3 to see the finished files, I finished them today so there is no actual tutorial yet, but I did already comment on the most important lines so you get an idea of what happens where.


 

 
Updated: August 02 2011 06:14:53.
Last Download: May 19 2012 12:45:34