procedure TForm1.Button1Click(Sender: TObject);
var
lb : TLogBrush;
begin
lb.lbStyle := BS_SOLID;
lb.lbColor := RGB(255, 0, 0);
lb.lbHatch := 0;
Canvas.Pen.Handle := ExtCreatePen(PS_GEOMETRIC or PS_INSIDEFRAME or
PS_ENDCAP_SQUARE or PS_JOIN_BEVEL, 20, lb, 0, nil); /// 自定义的Pen
BeginPath(Canvas.Handle);
Canvas.MoveTo(100, 30);
Canvas.LineTo(200, 100);
Canvas.LineTo(300, 30);
EndPath(Canvas.Handle);
StrokePath(Canvas.Handle); /// 渲染闭合的路径区域
Canvas.Pen.Width := 1;
end;