vb.net中怎么利用GDI画五边形
现在需要画一个五边形,如图(要像这样倾斜45度),在vb.net中能用GDI画出来吗,该怎么画?如果不能用GDI画的话,有什么其他的方法吗? GDI 画五边形 vb.net
[解决办法]
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dc As Graphics = Me.CreateGraphics()
Dim p(4) As Point
p(0).X = 100
p(0).Y = 15
p(1).X = 80
p(1).Y = 90
p(2).X = 90
p(2).Y = 120
p(3).X = 130
p(3).Y = 150
p(4).X = 430
p(4).Y = 550
dc.FillPolygon(New SolidBrush(Color.Green), p)
dc.DrawPolygon(New Pen(Color.DarkBlue, 6), p)
dc.Dispose()
End Sub
End Class
自己改动点的坐标值就可以了