Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents btnDraw As System.Windows.Forms.Button
Friend WithEvents lbldrawcurve As System.Windows.Forms.Label
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.btnDraw = New System.Windows.Forms.Button
Me.lbldrawcurve = New System.Windows.Forms.Label
Me.SuspendLayout()
'
'btnDraw
'
Me.btnDraw.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
Me.btnDraw.Location = New System.Drawing.Point(112, 16)
Me.btnDraw.Name = "btnDraw"
Me.btnDraw.Size = New System.Drawing.Size(72, 24)
Me.btnDraw.TabIndex = 0
Me.btnDraw.Text = "Draw"
'
'lbldrawcurve
'
Me.lbldrawcurve.BackColor = System.Drawing.SystemColors.ActiveCaption
Me.lbldrawcurve.Location = New System.Drawing.Point(24, 72)
Me.lbldrawcurve.Name = "lbldrawcurve"
Me.lbldrawcurve.Size = New System.Drawing.Size(240, 184)
Me.lbldrawcurve.TabIndex = 1
Me.lbldrawcurve.Text = " "
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.SystemColors.ActiveCaption
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Controls.Add(Me.lbldrawcurve)
Me.Controls.Add(Me.btnDraw)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub btnDraw_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDraw.Click
Dim FormSurface As Graphics = Me.CreateGraphics
FormSurface.Clear(Me.BackColor)
Dim Pen As New Pen(Color.Black, 1)
Dim Flag As New SolidBrush(Color.White)
Dim Brush As New SolidBrush(Color.Orange)
Dim CurvePoints() As Point = {New Point(100, 100), New Point(100, 0)}
Dim CurvePoints2() As Point = {New Point(100, 0), New Point(70, 60), New Point(90, 120)}
Dim CurvePoints3() As Point = {New Point(0, 100), New Point(230, 80), New Point(180, 120), New Point(30, 140)}
Dim CurvePoints4() As Point = {New Point(110, 0), New Point(140, 50), New Point(100, 100)}
Dim CurvePoints5() As Point = {New Point(0, 150), New Point(20, 170), New Point(40, 150), New Point(60, 170), New Point(80, 150), New Point(100, 170), New Point(120, 150), New Point(140, 170), New Point(160, 150), New Point(180, 170), New Point(200, 150), New Point(220, 170), New Point(240, 150)}
Dim drawcurvelabel As Graphics = Me.lbldrawcurve.CreateGraphics
drawcurvelabel.FillPolygon(Brush, CurvePoints3)
drawcurvelabel.FillClosedCurve(Flag, CurvePoints4)
drawcurvelabel.FillClosedCurve(Flag, CurvePoints2)
drawcurvelabel.DrawCurve(Pen, CurvePoints)
drawcurvelabel.DrawCurve(Pen, curvepoints5)
End Sub
End Class