
case RadioGroup1.ItemIndex of
0: b := TGPSolidBrush.Create(aclRed); // 實心
1: b := TGPHatchBrush.Create(HatchStyleSolidDiamond, aclYellow, aclCornflowerBlue); // 陰影
2: b := TGPTextureBrush.Create(img); // 紋理 (需圖片檔)
3: b := TGPLinearGradientBrush.Create(MakePoint(0,0), MakePoint(w,h), aclYellow, aclRed); // 漸變
end;
p := TGPPen.Create(b, 24); // 畫筆寬度 24
g.DrawEllipse(p, 30, 30, w-60, h-60);
g.DrawLine(p, 0, 0, w, h);
RadioGroup 切換四種模式,同一畫筆繪製橢圓與對角線,展示畫刷風格對筆劃的影響。