class1.cs

来自「C#实验报告 C#实验报告 C#实验报告 C#实验报告 C#实验报告 C#实验报」· CS 代码 · 共 46 行

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

	/// <summary>
	/// Class1 的摘要说明。
	/// </summary>
	public class CLine
	{
		public int x1,y1,x2,y2;
		public Color color;
		public int width;
		public Graphics g;

		/*public CLine()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
			/*x1=0;
			y1=0;
			x2=0;
			y2=0;
			color=Color.White;
			width=0;
			g=null;
		}*/

		public CLine(int x1,int y1,int x2,int y2,Color color,int width,Graphics g)
		{
			this.x1=x1;
			this.y1=y1;
			this.x2=x2;
			this.y2=y2;
			this.color=color;
			this.width=width;
			this.g=g;
		}

		public void DrawLine()
		{
			Pen pen1=new Pen(color,width);
			g.DrawLine(pen1,x1,y1,x2,y2);
		}

	}

⌨️ 快捷键说明

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