📄 ccircle.vb
字号:
Public Class CCircle
Private m_Center, m_PCircle As PointF
'圆心属性
Public Property Center() As PointF
Get
Return m_Center
End Get
Set(ByVal newValue As PointF)
m_Center = newValue
End Set
End Property
'圆上一点属性
Public Property PCircle() As PointF
Get
Return m_PCircle
End Get
Set(ByVal newValue As PointF)
m_PCircle = newValue
End Set
End Property
'半径属性,只读
Public ReadOnly Property Radius() As Single
Get
Dim r As Single= DistPtoP(m_Center, m_PCircle)
Return r
End Get
End Property
Public Sub New()
End Sub
Public Sub New(ByVal pCenter As PointF, ByVal pCircle As PointF)
m_Center = pCenter
m_PCircle = pCircle
End Sub
Public Sub Draw(ByVal g As Graphics, ByVal aPen As Pen)
g.DrawEllipse(aPen, m_Center.X - Radius, m_Center.Y - Radius, Radius * 2, Radius * 2)
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -