lazarus/examples/canvas_test/shapedwindowtest.pas
sekelsenmat bd44a633e1 Adds a large Canvas drawing example and test
git-svn-id: trunk@29587 -
2011-02-17 09:55:53 +00:00

57 lines
930 B
ObjectPascal

unit shapedwindowtest;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls, LCLIntf, LCLType;
type
{ TfrmShapedWindow }
TfrmShapedWindow = class(TForm)
btnClose: TButton;
procedure FormShow(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
frmShapedWindow: TfrmShapedWindow;
implementation
{ TfrmShapedWindow }
procedure TfrmShapedWindow.FormShow(Sender: TObject);
{var
Rgn: HRGN;
begin
Rgn := LCLIntf.CreateEllipticRgn(0, 0, 200, 200);
LCLIntf.SetWindowRgn(Handle, Rgn, False);
LCLIntf.DeleteObject(Rgn);}
var
Shape: TBitmap;
begin
Shape := TBitmap.Create;
try
Shape.Width := 200;
Shape.Height := 200;
Shape.Canvas.Ellipse(0, 0, 200, 200);
SetShape(Shape);
finally
Shape.Free;
end;
end;
initialization
{$I shapedwindowtest.lrs}
end.