type
a = array[0..7] of Cardinal;
var
Farbe: tagLOGBRUSH;
MyStyle: a = (3, 15, 1, 5, 1, 5, 6, 20); // z.B.
procedure ErzeugePen(cnv: TCanvas; clr: TColor; wdth: Cardinal; stl: a);
begin
Farbe.lbColor := clr;
cnv.Pen.Handle := ExtCreatePen(PS_GEOMETRIC or PS_USERSTYLE
or PS_ENDCAP_ROUND, wdth, Farbe, Length(stl), @stl);
end;
// Beispielaufruf
procedure TForm1.Button1Click(Sender: TObject);
begin
ErzeugePen(Canvas, clBlue, 3, MyStyle);
canvas.MoveTo(0, 10);
canvas.lineto(width, 10);
end;