Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Windows.Forms
public class LineJoinBevelMiterRound
public Shared Sub Main
Application.Run(New Form1)
End Sub
End class
public class Form1
Inherits System.Windows.Forms.Form
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
DrawSample(e.Graphics, 10, 10, Drawing2D.LineJoin.Bevel)
DrawSample(e.Graphics, 110, 10, Drawing2D.LineJoin.Miter)
DrawSample(e.Graphics, 210, 10, Drawing2D.LineJoin.Round)
End Sub
Private Sub DrawSample(ByVal gr As Graphics, ByVal x As Integer, ByVal y As Integer, ByVal join_style As Drawing2D.LineJoin)
Dim the_pen As New Pen(Color.Black, 20)
the_pen.LineJoin = join_style
gr.DrawString(join_style.ToString, Me.Font, Brushes.Black, x, y)
Dim pts() As Point = { New Point(x, y + 30),New Point(x + 50, y + 30),New Point(x + 25, y + 80) }
gr.DrawLines(the_pen, pts)
End Sub
Public Sub New()
MyBase.New()
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 273)
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
End Sub
End Class
|