Membuat Form Transparant di Delphi
Ikuti Langkah-langkah nya :
- Desain dlu gambar yg ingin ditampilkan,,,( disini ku kasih contoh gambar baju )...
- usahakan extentionnya bmp ya...
- trus wrna background #ff00ff (agak2 meerah muda gitu..)
- Trus tulis kan kode dibawah :
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, jpeg, ExtCtrls, StdCtrls, Menus, ActnList, XPMan;
type
TForm1 = class(TForm)
XPManifest1: TXPManifest;
Image1: TImage;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure WMNCHitTest(var msg : TWMNCHitTest);message
WM_NCHitTest;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.WMNCHitTest(var msg : TWMNCHitTest);
begin
inherited;
if (msg.Result = htClient) then
if Msg.YPos < Top + 40 then
msg.Result := htCaption;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
// Set form position to center of the screen
Position:= poScreenCenter;
// Hide form border
BorderStyle:= bsNone;
// Make tranparent form
TransparentColor:= True;
TransparentColorValue:= clFuchsia;
Color:= clFuchsia;
// Make a seethrough form
AlphaBlend:= True;
AlphaBlendValue:= 200;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Application.Terminate;
end;
end.
Tidak ada komentar:
Posting Komentar