Solved

Any tool/component out there to help making spiffy splashscreens with some graphic effects?

Posted on 2013-11-11
10
583 Views
Last Modified: 2013-11-14
Hello Experts, does anyone know of a tool/component that will help me make snazzy splashscreens (preferably free) ? I already have a splashscreen made, and I'm thinking if there was some tool that could make this splashscreen appear in a "slowly materializing" manner, and then disappear also in a similarly slowly de-materializing manner... that would be a great effect. Any ideas anyone?

Thanks!
    Shawn
0
Comment
Question by:shawn857
10 Comments
 
LVL 30

Expert Comment

by:Marco Gasi
ID: 39640782
There is this good tutorial about transparent splash screen which appears fading in: http://melander.dk/articles/alphasplash2/2/
This is the part two which uses png graphics. FTo use bmp see part one. If you're not interesting transparency, you can see only the part about fading in.
0
 
LVL 25

Expert Comment

by:Sinisa Vuk
ID: 39640966
There are free components on Torry.net and paid like this one:
http://www.tmssoftware.com/site/advsmoothsplashscreen.asp
0
 
LVL 19

Accepted Solution

by:
Thommy earned 500 total points
ID: 39641365
You can easily do it yourself...

unit USplash;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Imaging.jpeg, Vcl.ExtCtrls;

type
  TFrmSplash = class(TForm)
    Image1: TImage;
    Timer1: TTimer;
    procedure Timer1Timer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
    Completed: boolean;
    AlphaBlendStep: byte;
    TimerIntervall: integer;
    StayTime: integer;
  end;

var
  FrmSplash: TFrmSplash;

implementation

{$R *.dfm}

procedure TFrmSplash.FormCreate(Sender: TObject);
begin
  Self.AlphaBlend:=True;
  Self.AlphaBlendValue:=0;

  Self.AlphaBlendStep:=5;
  TimerIntervall:=50;
  Self.StayTime:=3000;

  self.Timer1.Interval:=TimerIntervall;
  self.Timer1.Enabled:=true;
  Completed := False;
end;

procedure TFrmSplash.Timer1Timer(Sender: TObject);
var
  OldAlphaBlendValue: byte;
begin
  oldAlphaBlendValue:=self.AlphaBlendValue;

  Self.AlphaBlendValue:=Self.AlphaBlendValue+AlphaBlendStep;
  if Self.AlphaBlendValue<OldAlphaBlendValue then self.AlphaBlendValue:=255;

  if self.AlphaBlendValue=255 then begin
    Timer1.Enabled:=false;
    Sleep(self.StayTime);
    Completed:=true;
  end;
end;

end.

Open in new window


program SplashScreen;

uses
  Vcl.Forms,
  system.sysutils,
  Unit1 in 'Unit1.pas' {Form1},
  USplash in 'USplash.pas' {FrmSplash};

{$R *.res}

begin
  Application.Initialize;
  Application.MainFormOnTaskbar := True;

  frmSplash := TfrmSplash.Create(nil);
  try
    frmSplash.Show;
    Application.CreateForm(TForm1, Form1);

    while not frmSplash.Completed do
      Application.ProcessMessages;
    frmSplash.Hide;
  finally
    frmSplash.Close;
    frmSplash.Free;
  end;

  Application.Run;
end.

Open in new window

0
 

Author Comment

by:shawn857
ID: 39643615
Thanks Thommy, I took your example and tried to go one step further by having my splashscreen also "fade out" (small demo proect attached). The fade in and fade out works good, but just before the main form appears, the splashscreen "flashes" once very quickly. Do you know if there's some way to stop that quick flash?

Thanks
   Shawn


P.S: I'm using Delphi 7 and a few things from your demo code did not compile for me:

(1) Application.MainFormOnTaskbar := True;
(2) The declaration of unit Vcl.Imaging.jpeg
SplashScreen.zip
0
 
LVL 19

Expert Comment

by:Thommy
ID: 39643915
Ok, I'm using Delphi XE3 and there is no flashing.
If you want I can send you my exe that you can see that.

I think I have a Delphi 7 version at one of my vmware machines.
Allow me a little time to look for it, then I will compile your demo source with Delphi 7 and check the flashing...
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 36

Expert Comment

by:Geert Gruwez
ID: 39644482
i tested your sample (and modified it somewhat)
you can strip all splash code from the .dpr file (except the uses line)
with this unit

does it still flash with this code below ?
(i think it 's something with the hide procedure and visible property)

unit uSplash;

interface

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

type
  TfrmSplash = class(TForm)
    Timer1: TTimer;
    Label1: TLabel;
    procedure Timer1Timer(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    fCompleted: boolean;
    fAlphaBlendStep: byte;
    fTimerIntervall: integer;
    fStayTime: integer;
    fDoneFadingIn : Boolean;
    fWaitForFadeOut: boolean;
  public
    constructor Create(aOwner: TComponent); override;
  end;

var
  frmSplash: TfrmSplash;

procedure SplashStart(WaitForFadeOut: Boolean = False);
procedure SplashStop(Immediate: Boolean = False);

implementation

{$R *.dfm}

procedure SplashStart(WaitForFadeOut: Boolean = False);
begin
  frmSplash := TfrmSplash.Create(nil);
  frmSplash.fWaitForFadeOut := WaitForFadeOut;
  frmSplash.Show;
  frmSplash.BringToFront;
  frmSplash.Update;
end;

procedure SplashStop(Immediate: Boolean = False);
begin
  if Immediate then
  begin
    if Assigned(frmSplash) then
    begin
      FreeAndNil(frmSplash);
      frmSplash := nil;
    end;
  end
    else
    frmSplash.fWaitForFadeOut := False;
end;

{ TfrmSplash }

constructor TfrmSplash.Create(aOwner: TComponent);
begin
  inherited Create(AOwner);
  AlphaBlend:=True;
  AlphaBlendValue := 0;
  fAlphaBlendStep := 5;
  fTimerIntervall := 100;
  fStayTime := 3000;
  fWaitForFadeOut := False;

  Timer1.Interval := fTimerIntervall;
  // Default Timer is disabled
  Timer1.Enabled := true;
  fCompleted := False;
  fDoneFadingIn := False;
end;

procedure TfrmSplash.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action := caFree;
  frmSplash := nil;
end;

procedure TfrmSplash.Timer1Timer(Sender: TObject);
var
  OldAlphaBlendValue: byte;
begin
  if not fDoneFadingIn then
  begin
    oldAlphaBlendValue := AlphaBlendValue;

    AlphaBlendValue := AlphaBlendValue + fAlphaBlendStep;
    if AlphaBlendValue < OldAlphaBlendValue then
      AlphaBlendValue := 255;

    if AlphaBlendValue >= 255 then
      fDoneFadingIn := True;
  end
    else
  begin
    if not fWaitForFadeOut then
    begin
      AlphaBlendValue := AlphaBlendValue - fAlphaBlendStep;
      if AlphaBlendValue <= 0 then
      begin
        Timer1.Enabled := false;
        fCompleted := true;
        Close;
      end;
    end;
  end;
end;

initialization
  // use false if no wait for fadeout
  SplashStart(True);
finalization
  SplashStop(True);
end.

Open in new window


in my main unit in formshow:
uses uSplash;

procedure TfrmMain.OnFormShow(Sender: TObject);
begin
  SplashStop;  
end;

Open in new window

0
 
LVL 19

Expert Comment

by:Thommy
ID: 39644778
I have tested your sample with Delphi 7.

My first thought also was,  that the flashing could have something to do with setting the visible property to false before calling the hide procedure.

But after cutting out the Alphacontrols and compiling your code with Delphi 7 everything works fine, although both, visible:=false and Hide are included.

Maybe it's somehing in combination with the Alphaskins.

First of all remove the line with visible:=false and check if flashing still occurs...
0
 

Author Comment

by:shawn857
ID: 39646045
Hi Thommy, yes I removed the visible:=false line and it still flashes - with or without it.

The culprit is indeed the AlphaSkins component - if you de-activate it (ie. Unit1 form, sSkinManager1 component, set Active property to False) and recompile, you will see the flashing is gone. I will have to contact the AlphaSkins people about this little glitch I guess.

Thanks!
    Shawn
0
 
LVL 19

Expert Comment

by:Thommy
ID: 39647321
Yeah, I have also made similar experiences with AlphaControls causing supoptimal screen behavior in previous projects...
0
 

Author Closing Comment

by:shawn857
ID: 39648629
Thanks Thommy... I'll probably go with just the fade-in as in your example, no need for the fade-out.

Thanks!
   Shawn
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
APK file name 7 64
indy tidtcpclient threading issue 8 54
Newbie Thread Programming 1 118
Best Firemonkey component pack 1 74
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now