unit Unit9;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, pngimage, ExtCtrls, StdCtrls, jpeg;
type
TForm9 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormPaint(Sender: TObject);
private
procedure WMERASEBKGND(var Mes:TMessage); message WM_ERASEBKGND;
procedure WMMOVE(var Mes:TMessage); message WM_MOVE;
{ Private declarations }
public
{ Public declarations }
end;
var
Form9: TForm9;
Bit : TBitmap;
implementation
{$R *.dfm}
procedure TForm9.FormCreate(Sender: TObject);
begin
Bit := TBitmap.Create;
Bit.Width := Form9.Width;
Bit.Height := Form9.Height;
Bit.PixelFormat := pf24bit;
form9.TransparentColor:=true;
form9.TransparentColorValue:=clFuchsia;
form9.Color:=clFuchsia;
end;
procedure TForm9.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture;
Perform (WM_SYSCOMMAND,SC_MOVE+2,0);
end;
procedure TForm9.FormPaint(Sender: TObject);
begin
form9.Canvas.Brush.Color:=clFuchsia;
form9.Canvas.Rectangle(bounds(1,1,Form9.Width-2,Form9.Height-2));
BitBlt(Bit.Canvas.Handle,0,0,Form9.Width,Form9.Height,GetDC(0),Form9.Left,Form9.Top,SRCCOPY);
Form9.Canvas.Draw(0,0,bit);
end;
procedure TForm9.WMERASEBKGND(var Mes: TMessage);
begin
Mes.Result:=1;
end;
procedure TForm9.WMMOVE(var Mes: TMessage);
begin
Repaint;
end;
end.