原来我以为,Word论坛高手如云,现在感觉太冷清了。
下面是我画的两种五角星,和我要求的还太远。
- Sub drawstar()
- Dim p(5, 1) As Integer
- pi = 3.1415926: r = 80: m = 126
- For i = 0 To 5
- p(i, 0) = r * Cos((m + i * 144) / 180 * pi)
- p(i, 1) = r * Sin((m + i * 144) / 180 * pi)
- Next
- For j = 0 To 4
- Set shp = ActiveDocument.Shapes.AddLine(p(j, 0) + 360, p(j, 1) + 270, p(j + 1, 0) + 360, p(j + 1, 1) + 270)
- Next
- End Sub
复制代码- Sub drawstar2()
- Dim p(5, 1) As Integer
- Dim p1(5, 1) As Integer
- pi = 3.1415926
- For i = 0 To 5
- p(i, 0) = 81 * Cos((54 + i * 144) / 180 * pi)
- p(i, 1) = 81 * Sin((54 + i * 144) / 180 * pi)
- p1(i, 0) = 31 * Cos((15 + i * 144) / 180 * pi)
- p1(i, 1) = 31 * Sin((15 + i * 144) / 180 * pi)
- Next
- For i = 1 To 5
- Set shp = ActiveDocument.Shapes.AddLine(p(i, 0) + 360, p(i, 1) + 270, p1(i, 0) + 360, p1(i, 1) + 270)
- Next
- For i = 1 To 4
- Set shp = ActiveDocument.Shapes.AddLine(p(i + 1, 0) + 360, p(i + 1, 1) + 270, p1(i - 1, 0) + 360, p1(i - 1, 1) + 270)
- Next
- Set shp = ActiveDocument.Shapes.AddLine(p(1, 0) + 360, p(1, 1) + 270, p1(4, 0) + 360, p1(4, 1) + 270)
- End Sub
复制代码
这个效果见图,一个空心,一个不是,顺序可能前后不一致。 |