资源简介
对编写画图软件有帮助哦!全部代码都是用C#编写的,对于初学者很有用的哦!

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
namespace CAD
{
[Serializable]
public abstract class baseShape
{
private bool isSelected = false;
private Point p1;
private Point p2;
public void setSelected()
{
this.isSelected = true;
}
public void setUnSelected()
{
this.isSelected = false;
}
public Point getP1()
{
return p1;
}
public void setP1(Point p1)
{
this.p1 = p1;
}
public Point getP2()
{
return p2;
}
public void setP2(Point p2)
{
this.p2 = p2;
}
public abstract void draw(Graphics g);
public abstract Point[] getAllHitPoint();
public abstract void setHitPoint(int hitPointIndex Point newPiont);
public abstract baseShape copySelf();
public bool catchHitPoint(Point hitPoint Point testPoint)
{
return this.getHitPointRectangle(hitPoint).Contains(testPoint);
}
public int catchShapePoint(Point testPoint)
{
int hitPointIndex = -1;
Point[] allHitPoint = this.getAllHitPoint();
for (int i = 0; i < allHitPoint.Length; i++)
{
if (this.catchHitPoint(allHitPoint[i] testPoint))
{
return i + 1;
}
}
if (this.catchShape(testPoint)) return 0;
return hitPointIndex;
}
public void drawHitPoint(Point hitPoint Graphics g)
{
g.DrawRectangle(baseShape.getPen() this.getHitPointRectangle(hitPoint));
}
public void drawAllHitPoinit(Graphics g)
{
Point[] allHitPoint = this.getAllHitPoint();
for (int i = 0; i < allHitPoint.Length; i++)
{
this.drawHitPoint(allHitPoint[i] g);
}
}
public Rectangle getHitPointRectangle(Point hitPoint)
{
Rectangle rect = new Rectangle();
rect.X = hitPoint.X - 2;
rect.Y = hitPoint.Y - 2;
rect.Width = 5;
rect.Height = 5;
return rect;
}
public abstract bool catchShape(Point testPoint);
public void superDraw(Graphics g)
{
this.draw(g);
if (this.isSelected) this.drawAllHitPoinit(g);
}
public static Pen getPen()
{
return new Pen(Color.Black);
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2756 2008-08-27 15:08 CAD\CAD\ba
文件 4147 2008-08-28 16:13 CAD\CAD\ba
文件 28672 2008-08-28 16:55 CAD\CAD\bin\Debug\CAD.exe
文件 65024 2008-08-28 16:55 CAD\CAD\bin\Debug\CAD.pdb
文件 5632 2005-12-08 14:51 CAD\CAD\bin\Debug\CAD.vshost.exe
文件 3425 2008-08-27 16:06 CAD\CAD\CAD.csproj
文件 7910 2008-08-28 16:50 CAD\CAD\CADfr
文件 7751 2008-08-28 16:27 CAD\CAD\CADfr
文件 6221 2008-08-28 16:27 CAD\CAD\CADfr
文件 3195 2008-08-27 16:36 CAD\CAD\HandTool.cs
文件 2639 2008-08-28 16:55 CAD\CAD\LineShape.cs
文件 1051 2008-08-28 15:29 CAD\CAD\LineTool.cs
文件 419 2008-08-28 16:56 CAD\CAD\obj\CAD.csproj.FileListAbsolute.txt
文件 180 2008-08-28 16:27 CAD\CAD\obj\Debug\CAD.CADfr
文件 845 2008-08-28 16:27 CAD\CAD\obj\Debug\CAD.csproj.GenerateResource.Cache
文件 28672 2008-08-28 16:55 CAD\CAD\obj\Debug\CAD.exe
文件 65024 2008-08-28 16:55 CAD\CAD\obj\Debug\CAD.pdb
文件 180 2008-08-28 16:07 CAD\CAD\obj\Debug\CAD.Properties.Resources.resources
文件 465 2008-08-27 14:43 CAD\CAD\Program.cs
文件 1162 2008-08-27 14:24 CAD\CAD\Properties\AssemblyInfo.cs
文件 2862 2008-08-27 14:24 CAD\CAD\Properties\Resources.Designer.cs
文件 5612 2008-08-27 14:24 CAD\CAD\Properties\Resources.resx
文件 1088 2008-08-27 14:24 CAD\CAD\Properties\Settings.Designer.cs
文件 249 2008-08-27 14:24 CAD\CAD\Properties\Settings.settings
文件 898 2008-08-27 14:24 CAD\CAD.sln
..A..H. 15872 2008-08-28 15:04 CAD\CAD.suo
目录 0 2008-08-27 14:43 CAD\CAD\obj\Debug\Refactor
目录 0 2008-08-27 14:24 CAD\CAD\obj\Debug\TempPE
目录 0 2008-08-28 16:13 CAD\CAD\bin\Debug
目录 0 2008-08-28 16:55 CAD\CAD\obj\Debug
............此处省略8个文件信息
相关资源
- 金橙子EZcad3软件包
- CAD图框外扩
- C# SCADA源码修复
- C# Cad2006二次开发之图形扩展属性读写
- C#开发 CAD 编程基础
- C# CAD 创建Ribbon菜单带图标
- C#读取DXF文件并显示dxf转hpgl
- 基于C#.NET的Autocad二次开发范例
- C#_PISDK快速高效率采集SCADA数据点
- C#等高线追踪
- C#语言操作 CAD二次开发
- 完整《基于Visual C#的AutoCAD 开发 及其
- AUTOCAD C#二次开发
- C#语言操作ActiveX_automation CAD二次开发
- CadLib4.0 Cad类库
- SharpScada组态软件
- C#解析CAD文件
- 深居浅出AutoCAD二次开发
- DWGdirect.NET文档说明C# 读写CAD文件DWG格
- C#二次开发CAD
- Teigha 各版本使用汇总
- AUTOCAD VBA&VB;.NET开发基础与教程第二版
- DWGdirect_NET文档说明C# .NET读写CAD文件
- AutoCAD VBA&VB;.NET开发基础与教程 C# PD
- c#操作CAD实时打开关闭
- C#开发交互式CAD系统
- C#开发cad画图软件 GDI+
- C# CAD画图软件
- C#实现的读取CAD表格文字
- C#实现CAD绘图功能
评论
共有 条评论