' Cherries Example ' This is an example of a Drawing project submission. 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 picDisplay As System.Windows.Forms.PictureBox Private Sub InitializeComponent() Me.picDisplay = New System.Windows.Forms.PictureBox Me.SuspendLayout() ' 'picDisplay ' Me.picDisplay.Location = New System.Drawing.Point(64, 88) Me.picDisplay.Name = "picDisplay" Me.picDisplay.Size = New System.Drawing.Size(176, 192) Me.picDisplay.TabIndex = 0 Me.picDisplay.TabStop = False ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(384, 286) Me.Controls.Add(Me.picDisplay) Me.Name = "Form1" Me.Text = "Cherries Example" Me.ResumeLayout(False) End Sub #End Region Private Sub Form1_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load picDisplay.BackColor = Color.Pink End Sub Private Sub Form1_Resize(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles MyBase.Resize picDisplay.Location = New Point(0, 0) picDisplay.Size = Me.ClientSize End Sub Private Sub picDisplay_Paint(ByVal sender As Object, _ ByVal e As System.Windows.Forms.PaintEventArgs) Handles picDisplay.Paint Dim g As Graphics = e.Graphics ' Create brushes Dim bWhite As New SolidBrush(Color.White) Dim bBlack As New SolidBrush(Color.Black) Dim bBlue As New SolidBrush(Color.Blue) Dim bBrown As New SolidBrush(Color.FromArgb(100, 60, 0)) Dim bGreen As New SolidBrush(Color.Green) Dim bOrange As New SolidBrush(Color.Orange) Dim bRed As New SolidBrush(Color.Red) ' Create pens Dim pBlack As New Pen(Color.Black, 2) Dim pGreen As New Pen(Color.Green, 2) Dim pBrown As New Pen(Color.FromArgb(100, 60, 0), 3) ' Draw head g.FillEllipse(bWhite, 200, 50, 100, 100) g.FillEllipse(bWhite, 196, 95, 6, 15) g.FillEllipse(bWhite, 298, 95, 6, 15) g.DrawEllipse(pBlack, 244, 101, 12, 13) g.FillRectangle(bWhite, 244, 101, 12, 5) ' Draw eyes g.DrawEllipse(pBlack, 227, 93, 15, 10) g.DrawEllipse(pBlack, 258, 93, 15, 10) g.FillEllipse(bBlue, 231, 95, 6, 6) g.FillEllipse(bBlue, 262, 95, 6, 6) ' Draw hair Dim hair As Integer = 200 g.FillRectangle(bBrown, hair, 72, 4, 22) hair += 6 : g.FillRectangle(bBrown, hair, 65, 4, 20) hair += 6 : g.FillRectangle(bBrown, hair, 60, 4, 20) hair += 6 : g.FillRectangle(bBrown, hair, 56, 4, 20) hair += 6 : g.FillRectangle(bBrown, hair, 52, 4, 20) hair += 6 : g.FillRectangle(bBrown, hair, 49, 4, 20) hair += 6 : g.FillRectangle(bBrown, hair, 47, 4, 20) hair += 6 : g.FillRectangle(bBrown, hair, 46, 4, 20) hair += 6 : g.FillRectangle(bBrown, hair, 45, 4, 20) hair += 6 : g.FillRectangle(bBrown, hair, 46, 4, 20) hair += 6 : g.FillRectangle(bBrown, hair, 47, 4, 20) hair += 6 : g.FillRectangle(bBrown, hair, 49, 4, 20) hair += 6 : g.FillRectangle(bBrown, hair, 52, 4, 20) hair += 6 : g.FillRectangle(bBrown, hair, 56, 4, 20) hair += 6 : g.FillRectangle(bBrown, hair, 60, 4, 20) hair += 6 : g.FillRectangle(bBrown, hair, 65, 4, 20) hair += 6 : g.FillRectangle(bBrown, hair, 72, 4, 20) ' Draw table g.FillRectangle(bGreen, 0, 114, 400, 186) g.DrawRectangle(pBlack, 0, 114, 400, 186) ' Draw bowl g.FillEllipse(bOrange, 50, 150, 150, 100) g.FillRectangle(bGreen, 50, 150, 150, 40) g.FillEllipse(bBlack, 50, 175, 150, 30) ' Draw cherries g.FillEllipse(bRed, 52, 170, 20, 20) g.FillEllipse(bRed, 70, 176, 20, 20) g.FillEllipse(bRed, 92, 174, 20, 20) g.FillEllipse(bRed, 110, 180, 20, 20) g.FillEllipse(bRed, 130, 177, 20, 20) g.FillEllipse(bRed, 152, 170, 20, 20) g.FillEllipse(bRed, 180, 172, 20, 20) g.FillEllipse(bRed, 70, 160, 20, 20) g.FillEllipse(bRed, 90, 160, 20, 20) g.FillEllipse(bRed, 110, 160, 20, 20) g.FillEllipse(bRed, 130, 160, 20, 20) g.FillEllipse(bRed, 150, 160, 20, 20) g.FillEllipse(bRed, 170, 160, 20, 20) g.FillEllipse(bRed, 225, 220, 20, 20) g.DrawLine(pBrown, 62, 170, 65, 150) g.DrawLine(pBrown, 80, 176, 79, 156) g.DrawLine(pBrown, 102, 174, 100, 154) g.DrawLine(pBrown, 120, 180, 124, 160) g.DrawLine(pBrown, 140, 177, 140, 157) g.DrawLine(pBrown, 162, 170, 160, 150) g.DrawLine(pBrown, 190, 172, 193, 152) g.DrawLine(pBrown, 80, 160, 79, 140) g.DrawLine(pBrown, 100, 160, 105, 140) g.DrawLine(pBrown, 120, 160, 122, 140) g.DrawLine(pBrown, 140, 160, 136, 140) g.DrawLine(pBrown, 160, 160, 160, 140) g.DrawLine(pBrown, 180, 160, 181, 140) g.DrawLine(pBrown, 235, 220, 236, 200) End Sub End Class