Private p2vbW As Integer Private p2vbH As Integer Private p2vbX1 As Integer Private p2vbY1 As Integer Private p2vbX2 As Integer Private p2vbY2 As Integer Private myPen as Pen Private formGraphics As System.Drawing.Graphics Private myBrush As System.Drawing.SolidBrush ' A simple graphics example constructs a face from basic shapes. ' ' from graphics import * Public Sub main() Dim winWidth As Integer winWidth = 200 ' give a name to the window width Dim winHeight As Integer winHeight = 150 ' and height Dim win As Integer Form1.Text = "Face" Form1.Width = winWidth + 100 p2vbW = winWidth Form1.Height = winHeight + 100 p2vbH = winHeight p2vbX1 = 0 p2vbY1 = 0 p2vbX2 = winWidth p2vbY2 = winHeight ' make right side up coordinates! Dim head As RectangleF formGraphics = Form1.CreateGraphics() myPen = New Pen(Drawing.Color.Black, 1) head.X = 40 head.Y = 100 head.Width = 25 head.Height = 25 formGraphics.DrawEllipse(myPen, head) myBrush = New System.Drawing.SolidBrush(System.Drawing.Color.yellow) formGraphics.FillEllipse(myBrush, head) Dim eye1 As RectangleF myPen = New Pen(Drawing.Color.Black, 1) eye1.X = 30 eye1.Y = 105 eye1.Width = 5 eye1.Height = 5 formGraphics.DrawEllipse(myPen, eye1) myBrush = New System.Drawing.SolidBrush(System.Drawing.Color.blue) formGraphics.FillEllipse(myBrush, eye1) Dim eye2 As Integer myPen = New Pen(Drawing.Color.Black, 1) formGraphics.DrawLine(myPen, 45, 105, 55, 105) myPen = New Pen(Drawing.Color.Black, 3) formGraphics.DrawLine(myPen, 45, 105, 55, 105) Dim mouth As RectangleF mouth = New RectangleF(New Point(30, 90), New SizeF(50, 85)) ' set corners of bounding box myPen = New Pen(Drawing.Color.Black, 1) formGraphics.DrawEllipse(myPen, mouth) myBrush = New System.Drawing.SolidBrush(System.Drawing.Color.red) formGraphics.FillEllipse(myBrush, mouth) Dim message As New Label message.Left = p2vbW * ((winWidth/2) / (p2vbX2 - p2vbX1)) message.Top = p2vbH - (p2vbH * (( 20) / (p2vbY2 - p2vbY1))) message.Text = "Click anywhere to quit." message.AutoSize = True Form1.Controls.Add(message) End Sub 'main()