The document contains code that draws various shapes and lines in a PictureBox control. It creates graphics objects, defines rectangles and points, sets drawing properties like smoothing and colors, and calls methods like DrawRectangle, DrawEllipse, FillEllipse, DrawPolygon, and DrawLine to render the shapes at specified coordinates.
The document contains code that draws various shapes and lines in a PictureBox control. It creates graphics objects, defines rectangles and points, sets drawing properties like smoothing and colors, and calls methods like DrawRectangle, DrawEllipse, FillEllipse, DrawPolygon, and DrawLine to render the shapes at specified coordinates.
The document contains code that draws various shapes and lines in a PictureBox control. It creates graphics objects, defines rectangles and points, sets drawing properties like smoothing and colors, and calls methods like DrawRectangle, DrawEllipse, FillEllipse, DrawPolygon, and DrawLine to render the shapes at specified coordinates.
The document contains code that draws various shapes and lines in a PictureBox control. It creates graphics objects, defines rectangles and points, sets drawing properties like smoothing and colors, and calls methods like DrawRectangle, DrawEllipse, FillEllipse, DrawPolygon, and DrawLine to render the shapes at specified coordinates.
Private Sub Dobel_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Dobel.Click Dim G As Graphics G = PictureBox1.CreateGraphics G.SmoothingMode = Drawing.Drawing2D.SmoothingMode.AntiAlias Dim R1, R2, R3, R4, R5, R6 As Rectangle Dim A As New Point(50, 120) Dim B As New Point(90, 160) Dim C As New Point(50, 200) Dim D As New Point(10, 160) Dim myPoints As Point() = {A, B, C, D} Dim brush As System.Drawing.SolidBrush brush = New System.Drawing.SolidBrush(Color.BlueViolet) R1 = New Rectangle(10, 10, 60, 60) R2 = New Rectangle(80, 10, 60, 60) R3 = New Rectangle(10, 80, 80, 30) R4 = New Rectangle(100, 80, 80, 30) R5 = New Rectangle(10, 120, 80, 80) R6 = New Rectangle(100, 120, 80, 80) G.FillEllipse(Brushes.CadetBlue, R1) G.DrawRectangle(Pens.Purple, R1) G.DrawEllipse(New Pen(Color.Red, 3), R2) G.DrawRectangle(Pens.Blue, R2) G.DrawEllipse(New Pen(Color.DarkSeaGreen, 3), R3) G.DrawRectangle(Pens.Red, R3) G.FillEllipse(Brushes.BlueViolet, R4) G.DrawRectangle(Pens.Purple, R4) G.FillPolygon(Brushes.Cyan, myPoints) G.DrawPolygon(Pens.Orchid, myPoints) G.DrawRectangle(Pens.Black, R5) G.DrawLine(New Pen(Color.DarkRed, 2), 100, 120, 179, 199) G.DrawLine(New Pen(Color.DarkRed, 2), 179, 120, 100, 199) G.DrawRectangle(Pens.RoyalBlue, R6) End Sub End Class 10,10 80,10 10