FillPolygon
FillPolygon用于填充一个由任意多个点指定的多边形。
FillPolygon(color, points)
FillPolygon(brush,
points)
参数 | 说明 |
color | 填充颜色 |
brush | 指定用于填充的画刷,Brush类型。
过Brushes可以返回各种颜色的默认画刷,例如: Dim br As Brush = Brushes.Red '获得红色的画刷可以用自定义的颜色来定义画刷,例如:
Dim
br1
As
Brush
=
New
SolidBrush(Color.FromARGB(255,255,192,203)) |
points | PointF数组 |
示例
Dim
file
As
String
=
"c:\temp\test.pdf"
Dim
pdc
As
New
PDFCreator()
Dim
pts()
As
PointF = {New
PointF(200, 72),
New
PointF(150, 160),
New
PointF(250, 160)}
pdc.FillPolygon(Color.PowderBlue, pts)
'填充三角形
pdc.DrawPolygon(Pens.Green, pts)
'绘制三角形边框
pdc.Save(file)
Process.Start(file)
执行后会生成一个等腰三角形: