Solved

Transparent SplashScreen

Posted on 1999-01-04
7
206 Views
Last Modified: 2010-04-04
Hello And Happy New Year!!!

How Can I Make Transparent SplashScreen?
0
Comment
Question by:mummi
7 Comments
 
LVL 5

Expert Comment

by:heathprovost
ID: 1354524
add the following to your splashscreen form, this will make the window itself transparent.  Not sure if this is what you want though.

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
  TForm1 = class(TForm)
  private
    { Private declarations }
  public
    { Public declarations }
    procedure CreateParams(var Params: TCreateParams); override;
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  Inherited CreateParams(Params);
  Params.ExStyle := Params.ExStyle + WS_EX_TRANSPARENT;
end;

end.
0
 

Expert Comment

by:tleforge
ID: 1354525
You may also want to try the following code.  It's been passed
around quite frequently lately.  Try it.  I think you'll be
impressed.

//**************************************************************
//**** Code Begins Here ****************************************
//**************************************************************

unit Unit1;

interface

uses  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls, Buttons, ComCtrls, Grids, DBGrids;
type
  TForm1 = class(TForm)
    Panel1: TPanel;
    Button1: TButton;
    Button2: TButton;
    ListBox1: TListBox;
    ComboBox1: TComboBox;
    DBGrid1: TDBGrid;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure TransForm(Sender: TObject);
    procedure FormResize(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.TransForm(Sender: TObject);
var
  FullRgn, ClientRgn, ButtonRgn: THandle;
  Margin, x, y, z: Integer;
  l,t,h,w: Integer;
begin
  Margin := (Width - ClientWidth) div 2;
  FullRgn := CreateRectRgn(0, 0, Width, Height);
  x := Margin;
  y := Height - ClientHeight - Margin;
  ClientRgn := CreateRectRgn(x, y, x + ClientWidth, y + ClientHeight);
  CombineRgn(FullRgn, FullRgn, ClientRgn, RGN_DIFF);
  for z := ComponentCount - 1 downto 0 do begin
    if Components[z] is {TControl} TWinControl then
      if (Components[z].GetParentComponent is TForm) then
      with Components[z] as {TControl} TWinControl do begin
        l := Left;
        t := Top;
        h := Height;
        w := Width;
      end;
      x := Margin + l;
      y := (Height - ClientHeight - Margin) + t;
    ButtonRgn := CreateRectRgn(x, y, x + w, y + h);
    CombineRgn(FullRgn, FullRgn, ButtonRgn, RGN_OR);
  end;
  SetWindowRgn(Handle, FullRgn, TRUE);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  TransForm(Sender);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Close;
end;

procedure TForm1.FormResize(Sender: TObject);
begin
  TransForm(Sender);
end;

end.

//**************************************************************
//**** Code Ends Here ******************************************
//**************************************************************

0
 
LVL 5

Expert Comment

by:heathprovost
ID: 1354526
you should except tlrforge's comment over mine, much more complete answer.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Expert Comment

by:tleforge
ID: 1354527
Actually, I'm not asking for any points.  The code segment I
submitted is not completely original.  I did make a few
improvements, but nothing that warrants any points.

0
 
LVL 1

Accepted Solution

by:
adeng earned 40 total points
ID: 1354528
Try to download a cool form in http://www.lawrenz.com/coolform/

it make a transparent form very easy from a picture, it's inculding source code for delphi.

Adeng.
0
 

Expert Comment

by:joanita
ID: 1354529
Include the following code in the onCreate event handler of the splash screen form:
BorderStyle := bsNone;
brush.style :=bsClear;
Additionally if you want the image itself of the splash screen to be tranparent set its transparent property to true.

0
 

Author Comment

by:mummi
ID: 1354530
Yesssss....Thanks..
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 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

16 Experts available now in Live!

Get 1:1 Help Now