How to draw Gradient Ellipse in VB.Net

By James J

Show how to draw gradient ellipse in different different gradient modes

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim GradientRectangle As New Rectangle(10, 10, 100, 100)

Using GradientGraphic =
Me.CreateGraphics()
Using
GradientBrush As New LinearGradientBrush(GradientRectangle, Color.Red, Color.Blue, LinearGradientMode.BackwardDiagonal)
GradientGraphic.
FillEllipse(GradientBrush, New Rectangle(10, 10, 100, 100))
End Using
End Using
End Sub


> See below image

> Here different different "LinearGradientMode" are availabe & that you can use...

> LinearGradientMode.Horizontal

> LinearGradientMode.Vertical

> LinearGradientMode.ForwardDiagonal

> LinearGradientMode.BackwardDiagonal

How to draw Gradient Ellipse in VB.Net  (662 Views)