S
Slickuser
How do I automatic move the X & Y to create a ellipse function as
below, DrawCircle?
Or there any sample source code out there?
I want it move down by user input. How can I achieve this? Thanks.
Imports System
Imports System.Drawing
Public Class circle
Private Sub circle_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Private Sub mainTab_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim myPen As New
System.Drawing.Pen(System.Drawing.Color.Black)
myPen.DashStyle = Drawing.Drawing2D.DashStyle.Solid
Dim widthPen As Integer = 10
myPen.Width = widthPen
Dim x1 As Integer = 10
Dim y1 As Integer = 20
Dim y2 As Integer = 70
e.Graphics.DrawLine(myPen, x1, y1, x1, y2)
x1 = x1 + 25 + widthPen
e.Graphics.DrawLine(myPen, x1, y1, x1, y2)
myPen.Dispose()
End Sub
Private Sub DrawCircle(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles Me.Paint
' Create pen.
Dim redBrush As New SolidBrush(Color.Red)
' Create location and size of ellipse.
Dim x As Integer = 75
Dim y As Integer = 25
Dim width As Integer = 75
Dim height As Integer = 50
' Draw ellipse to screen.
e.Graphics.FillEllipse(redBrush, x, y, width, height)
End Sub
End Class
below, DrawCircle?
Or there any sample source code out there?
I want it move down by user input. How can I achieve this? Thanks.
Imports System
Imports System.Drawing
Public Class circle
Private Sub circle_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Private Sub mainTab_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim myPen As New
System.Drawing.Pen(System.Drawing.Color.Black)
myPen.DashStyle = Drawing.Drawing2D.DashStyle.Solid
Dim widthPen As Integer = 10
myPen.Width = widthPen
Dim x1 As Integer = 10
Dim y1 As Integer = 20
Dim y2 As Integer = 70
e.Graphics.DrawLine(myPen, x1, y1, x1, y2)
x1 = x1 + 25 + widthPen
e.Graphics.DrawLine(myPen, x1, y1, x1, y2)
myPen.Dispose()
End Sub
Private Sub DrawCircle(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles Me.Paint
' Create pen.
Dim redBrush As New SolidBrush(Color.Red)
' Create location and size of ellipse.
Dim x As Integer = 75
Dim y As Integer = 25
Dim width As Integer = 75
Dim height As Integer = 50
' Draw ellipse to screen.
e.Graphics.FillEllipse(redBrush, x, y, width, height)
End Sub
End Class