Private Sub PictureBox2_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox2.Paint Dim g As Graphics = e.Graphics Dim trnsRedBrush As New SolidBrush(Color.FromArgb(&H78FF0000)) Dim trnsGreenBrush As New SolidBrush(Color.FromArgb(&H7800FF00)) Dim trnsBlueBrush As New SolidBrush(Color.FromArgb(&H780000FF)) Dim triBase As Single = 100 Dim triHeight As Single = CSng(Math.Sqrt((3 * (triBase * _ triBase) / 4))) Dim x1 As Single = 40 Dim y1 As Single = 40 g.FillEllipse(trnsRedBrush, x1, y1, 2 * triHeight, 2 * triHeight) g.FillEllipse(trnsGreenBrush, x1 + triBase / 2, y1 + triHeight, _ 2 * triHeight, 2 * triHeight) g.FillEllipse(trnsBlueBrush, x1 + triBase, y1, 2 * triHeight, _ 2 * triHeight) End Sub Private Sub PictureBox3_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox3.Paint Dim myRect As New Rectangle(20, 20, 200, 100) Dim myLGBrush As New LinearGradientBrush(myRect, Color.Blue, _ Color.Red, 0.0F, True) e.Graphics.FillEllipse(myLGBrush, myRect) Dim transformArray As Point() = {New Point(20, 150), _ New Point(400, 150), New Point(20, 200)} Dim myMatrix As New Matrix(myRect, transformArray) myLGBrush.MultiplyTransform(myMatrix, MatrixOrder.Prepend) e.Graphics.FillEllipse(myLGBrush, 20, 150, 380, 50) myLGBrush.ResetTransform() e.Graphics.FillEllipse(myLGBrush, 20, 250, 200, 100) End Sub Private Sub PictureBox4_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox4.Paint Dim x As Integer = 20 Dim y As Integer = 20 Dim h As Integer = 100 Dim w As Integer = 200 Dim myRect As New Rectangle(x, y, w, h) Dim myLGBrush As New LinearGradientBrush(myRect, Color.Blue, _ Color.Aquamarine, 45.0F, True) e.Graphics.FillEllipse(myLGBrush, x, y, w, h) Dim clonedLGBrush As LinearGradientBrush = _ CType(myLGBrush.Clone(), LinearGradientBrush) clonedLGBrush.TranslateTransform(-100.0F, 0.0F) y = 150 e.Graphics.FillEllipse(clonedLGBrush, x, y, w, h) End Sub