DrawToolsRedux/DrawRectangle.cs

(开头部分) 10KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Globalization;
using System.Runtime.Serialization;
using System.Windows.Forms;

namespace DrawTools
{
	/// <summary>
	/// Rectangle graphic object
	/// </summary>
	[Serializable]
	public class DrawRectangle : DrawObject
	{
		private Rectangle rectangle;

		private const string entryRectangle = "Rect";

		protected Rectangle Rectangle
		{
			get { return rectangle; }
			set { rectangle = value; }
		}

		/// <summary>
		/// Clone this instance
		/// </summary>
		public override DrawObject Clone()
		{
			DrawRectangle drawRectangle = new DrawRectangle();
			drawRectangle.rectangle = rectangle;

			FillDrawObjectFields(drawRectangle);
			return drawRectangle;
		}

		public DrawRectangle()
		{
			SetRectangle(0, 0, 1, 1);
		}

		public DrawRectangle(int x, int y, int width, int height)
		{
			Center = new Point(x + (width / 2), y + (height / 2));
			rectangle.X = x;
			rectangle.Y = y;
			rectangle.Width = width;
			rectangle.Height = height;
			TipText = String.Format("Rectangle Center @ {0}, {1}", Center.X, Center.Y);
		}

		public DrawRectangle(int x, int y, int width, int height, Color lineColor, Color fillColor)
		{
			Center = new Point(x + (width / 2), y + (height / 2));
			rectangle.X = x;
			rectangle.Y = y;
			rectangle.Width = width;
			rectangle.Height = height;
后面还有 367 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。