gdi+画连续线问题!
我想用gdi+绘出连续线,但是gdi+貌似没有给出相应的函数,而cdc的算法又不行。求帮助!好人一生平安呀!
测试这段代码
Dim g As Graphics = PictureBox1.CreateGraphics()
Dim blackpen As New Pen(Color.CadetBlue, 3)
'g.DrawLine(blackpen, 10, 10, 20, 10)
'g.DrawLine(Pens.Yellow, 10, 10, 20, 10)
Dim point1 As New Point(30, 20)
Dim point2 As New Point(60, 150)
Dim point3 As New Point(120, 30)
Dim point4 As New Point(190, 60)
Dim point5 As New Point(200, 140)
Dim point6 As New Point(220, 100)
Dim point7 As New Point(250, 40)
Dim point8 As New Point(280, 100)
Dim cupoints As Point() = {point1, point2, point3, point4, point5, point6}
g.DrawCurve(blackpen, cupoints, 0.3F)
' g.DrawBezier(blackpen, point1, point2, point3, point4)
Dim bezierPoints As Point() = {point1, point2, point3, point4, point5, point6, point7}
g.DrawBeziers(Pens.Coral, bezierPoints)
Dim MyPen As New Pen(Color.Black, 1)
Dim MyRPen As New Pen(Color.Red, 3)
'MyPen.EndCap = LineCap.AnchorMask
'MyPen.EndCap = LineCap.ArrowAnchor
' MyPen.EndCap = LineCap.Triangle
' MyPen.EndCap = LineCap.RoundAnchor
' MyPen.EndCap = LineCap.SquareAnchor
'g.DrawLine(MyPen, point1, point2)
'g.DrawLine(MyPen, point2, point3)
'g.DrawLine(MyPen, point3, point4)
'g.DrawLine(MyPen, point4, point5)
'g.DrawLine(MyPen, point5, point6)
'g.DrawLine(MyPen, point6, point7)
g.DrawLines(MyPen, cupoints)
g.DrawLine(MyRPen, point1.X, point1.Y, (point1.X + 3), point1.Y)
g.DrawLine(MyRPen, point2.X, point2.Y, (point2.X + 3), point2.Y)
g.DrawLine(MyRPen, point3.X, point3.Y, (point3.X + 3), point3.Y)
g.DrawLine(MyRPen, point4.X, point4.Y, (point4.X + 3), point4.Y)
g.DrawLine(MyRPen, point5.X, point5.Y, (point5.X + 3), point5.Y)
g.DrawLine(MyRPen, point6.X, point6.Y, (point6.X + 3), point6.Y)
blackpen.Dispose()
MyPen.Dispose()
g.Dispose()