unit Unit1;
interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs;
type TForm1 = class(TForm)
procedure FormPaint(Sender: TObject);
end;
var Form1: TForm1;
implementation
{$R *.dfm}
uses GDIPOBJ, GDIPAPI;
procedure TForm1.FormPaint(Sender: TObject);
var g: TGPGraphics;
path: TGPGraphicsPath;
p: TGPPen;
b: TGPBrush;
begin
g := TGPGraphics.Create(Canvas.Handle);
path := TGPGraphicsPath.Create;
path.AddLine(10,10,110,110);
path.AddRectangle(MakeRect(10,10,100,100));
path.AddEllipse(MakeRect(10,10,100,100));
p := TGPPen.Create(aclRed);
b := TGPSolidBrush.Create(aclYellow);
g.FillPath(b, path);
g.DrawPath(p, path);
b.Free;
p.Free;
path.Free;
g.Free;
end;
end.
GDI+ 路径 - Create、FillPath、DrawPath
最新推荐文章于 2023-04-24 20:39:45 发布