
單位百分比陣列,成對定義子線段起訖位置 (0.0-1.0):
[0.00,0.10, 0.45,0.55, 0.90,1.00] → 3 條細線[0.00,0.50, 0.90,1.00] → 1 條粗線 + 1 條細線LabeledEdit 輸入筆寬RadioGroup 選單:單實線/均分線/粗細線
p := TGPPen.Create(aclCoral); p.SetWidth(StrToFloatDef(LabeledEdit1.Text,10));
case RadioGroup1.ItemIndex of
1: p.SetCompoundArray(@arr1, 6);
2: p.SetCompoundArray(@arr2, 4);
end;
g.DrawLine(p, 0, 0, ClientWidth, ClientHeight);
g.DrawEllipse(p, MakeRect(ClientRect));
展示複合畫筆對直線與曲線的同樣效果。