DrawArc
DrawArc方法用于绘制弧线,弧线是一个圆形(或椭圆)的一部分,DrawArc的法为:
DrawArc(pen, rect, startAngle, sweepAngle)
参数 | 说明 |
pen | 画笔 |
rect | RectangleF类型,用于定义圆形(或椭圆)所在的四边形 |
startAngle | 弧线的起始角度 |
sweepAngle | 弧线的扫掠角度 |
示例
Dim
file
As
String
=
"c:\temp\test.pdf"
Dim
pdc
As
New
PDFCreator()
Dim
rect
As
New
RectangleF(100, 100, 250, 250)
Dim
statAngle
As
Integer
= 0
Dim
sweepAngle
As
Integer
= 45
Dim
myColors()
As
Color = {color.Red, color.Green, Color.Blue, color.LightSeaGreen,
color.LightGreen}
For
i
As
Integer
= 0
To
4
Dim
p
As
New
Pen(myColors(i), 20)
pdc.DrawArc(p, rect, statAngle, sweepAngle)
statAngle = statAngle + sweepAngle
Next
pdc.Save(file)
Process.Start(file)
生成的文档为: