46 lines
1.1 KiB
C#
46 lines
1.1 KiB
C#
using System;
|
|
using System.Drawing;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
namespace HYJig
|
|
{
|
|
public class XCircle2D : XDrawable2D, ICloneable
|
|
{
|
|
public XCircle2D(Point ptCenter, int iRadius)
|
|
{
|
|
this.PointCenter = ptCenter;
|
|
this.Radius = iRadius;
|
|
}
|
|
|
|
public override void Draw(XGraphics g)
|
|
{
|
|
try
|
|
{
|
|
Point point = new Point(this.PointCenter.X - this.Radius, this.PointCenter.Y - this.Radius);
|
|
RectangleF rectangleF = new RectangleF((float)(this.PointCenter.X - this.Radius), (float)(this.PointCenter.Y - this.Radius), (float)(2 * this.Radius), (float)(2 * this.Radius));
|
|
g.m_graphics.DrawArc(g.m_pen, rectangleF, 0f, 360f);
|
|
}
|
|
catch
|
|
{
|
|
}
|
|
}
|
|
|
|
public object Clone()
|
|
{
|
|
try
|
|
{
|
|
return new XCircle2D(this.PointCenter, this.Radius);
|
|
}
|
|
catch
|
|
{
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public Point PointCenter { get; set; }
|
|
|
|
public int Radius { get; set; }
|
|
|
|
}
|
|
}
|