资源简介
大学课程作业,使用C#做的简单的画图工具,可以画一些基本的形状并自由调整位置、大小。除此之外,若在画布上按规定格式画好流程图,可以执行流程图。
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using System.Diagnostics;
using System.IO;
using scriptInterpret;
namespace BrandNewShape
{
enum Condition { normal creating }
[Serializable]
class Canva
{
Command commandReciever;
ElementCollection childElements;
private Form1 parentForm;//所属的窗体
Rectangle recDrag;//创建图形时的虚线框
List curIn = null;
public List curMyScr = new List();
public List myScr = new List();
string script;
List pts = new List();
Point[] pt = new Point[2] { new Point(-1 -1) new Point(-1 -1) };
public bool SpecialRequest = false;
public Mark SpecialMark;
public bool ElementSpecialRequest = false;
public Element SpecialElement;
Point startPos;
Condition condition = Condition.normal;
public string elementChooser = null;
Stopwatch time;
public bool IsCtrl = false;
public Command CommandReciever
{
get { return commandReciever; }
set
{
commandReciever = value;
switch (value.CommandText)
{
case “MouseDown“: onmousedown(); break;
case “MouseDownMove“: onmousedownMove(); break;
case “MouseMove“: onmousemove(); break;
case “MouseRightDown“: OnMouseRightDown(); break;
case “KeyDown“: onkeydown(); break;
case “KeyUp“: onkeyup(); break;
case “Copy“: oncopy(); break;
case “Paste“: onpaste(); break;
case “MouseUp“: onmouseup(); break;
default: break;
}
}
}
public ElementCollection ChildElements
{
get { return childElements; }
set { childElements = value; }
}
public Form1 ParentForm
{
get { return parentForm; }
set { parentForm = value; }
}
public Rectangle RecDrag
{
get { return recDrag; }
set { recDrag = value; }
}
public string script
{
get { return script; }
}
public Canva()
{
childElements = new ElementCollection(this);
time = new Stopwatch();
}
public Canva(Form1 form1)
{
this.parentForm = form1;
childElements = new ElementCollection(this);
time = new Stopwatch();
pts.Clear();
}
public void Draw(Graphics obj)
{
obj.Clear(Color.White);
foreach (Element ele in childElements)
{
if(ele.IsSelected == false)
el
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-09-27 21:11 BrandNewShape-master\
目录 0 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\
文件 2542 2014-09-27 16:05 BrandNewShape-master\BrandNewShape.sln
文件 134144 2014-09-27 16:05 BrandNewShape-master\BrandNewShape.suo
文件 195584 2014-09-27 21:19 BrandNewShape-master\BrandNewShape.v11.suo
目录 0 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\bin\
目录 0 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\bin\Debug\
文件 0 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\bin\Debug\1.txt
文件 78336 2014-09-27 21:11 BrandNewShape-master\BrandNewShape\bin\Debug\BrandNewShape.exe
文件 249344 2014-09-27 21:11 BrandNewShape-master\BrandNewShape\bin\Debug\BrandNewShape.pdb
文件 22984 2014-09-27 21:13 BrandNewShape-master\BrandNewShape\bin\Debug\BrandNewShape.vshost.exe
文件 490 2012-06-06 02:06 BrandNewShape-master\BrandNewShape\bin\Debug\BrandNewShape.vshost.exe.manifest
文件 2770 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\bin\Debug\example.txt
文件 24064 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\bin\Debug\ex
文件 206336 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\bin\Debug\ex
文件 0 2014-09-27 21:19 BrandNewShape-master\BrandNewShape\bin\Debug\lastFile.txt
文件 191 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\bin\Debug\myfile.txt
文件 204 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\bin\Debug\qqqq.txt
文件 136 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\bin\Debug\qqqqq.txt
文件 112 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\bin\Debug\sun.txt
文件 210 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\bin\Debug\wh.txt
文件 5820 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\BrandNewShape.csproj
文件 30012 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\Canva.cs
文件 6705 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\ClassDiagram1.cd
文件 7991 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\ClassDiagram2.cd
目录 0 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\Command\
文件 319 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\CommandList.txt
文件 1059 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\Command\Command.cs
文件 1788 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\DebugForm.cs
文件 5422 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\DebugForm.Designer.cs
文件 5698 2014-09-27 16:05 BrandNewShape-master\BrandNewShape\DebugForm.resx
............此处省略122个文件信息
- 上一篇:C# 围棋程序代码
- 下一篇:C# 五子棋(课程设计+包含详细设计文档)
评论
共有 条评论