ellipse.cs

来自「CSharp的MDI窗口事例」· CS 代码 · 共 24 行

CS
24
字号
using System;
using System.Drawing;

namespace MDICSharp
{
	[Serializable]
	public class Ellipse : MDICSharp.Shape
	{
		public Ellipse(Point st, Point ep)
		{
			StartPoint = st;
			EndPoint = ep;
		} // constructor
		public override void DrawShape(Graphics dc, Pen drawPen, Brush brush)
		{
			Rectangle drawArea;
			Size rectSize = new Size((EndPoint.X - StartPoint.X), (EndPoint.Y - StartPoint.Y));
			drawArea = new Rectangle(StartPoint, rectSize);
			dc.DrawEllipse(drawPen, drawArea);
			dc.FillEllipse(brush, drawArea);
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?