unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
procedure FormPaint(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
uses
GDIPAPI,GDIPOBJ;
procedure TForm1.FormPaint(Sender: TObject);
var
g:TGPGraphics;
p:TGPPen;
begin
g:=TGPGraphics.Create(Canvas.Handle);
g.Clear(aclWhite);
p:=TGPPen.Create(aclRed,2);
g.DrawLine(p,20, 40, 200, 40);
g.DrawLine(p,MakePoint(20,60), MakePoint(200,60));
g.DrawLine(p,20.9, 80.0, 200.9, 80.0);
g.DrawLine(p,MakePoint(20.9, 100.0), MakePoint(200.9, 100.0));
p.Free;
g.Free;
end;
end.