GDI+ 路径 - Create、FillPath、DrawPath

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. 
—— 完 ——
相关推荐
评论

立 为 非 似

中 谁 昨 此

宵 风 夜 星

。 露 , 辰

文章点击榜

细 无 轻 自

如 边 似 在

愁 丝 梦 飞

。 雨 , 花