资源简介
winform 项目 的 小画笔,,采用了封装,,继承 面向对象

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Imaging;
using Jackeyyang.DrawShap.DrawClass;
using System.Collections;
namespace Jackeyyang.DrawShap
{
#region 定义枚举
public enum DrawType
{
Xian = 1
Yuan
Quxian
Juxing
ShixinTuoYuan
ShixinJuXing
};
public enum LineType
{
Xixian = 3
Cuxian = 6
Tecuxian = 9
}
#endregion
public partial class MainFrom : Form
{
private DrawType currentType = DrawType.Xian; // 当前类型:线条
private Color currentColor = Color.Black; // 当前颜色
private LineType currentLine = LineType.Xixian;// 当前线条类型
private Bitmap buffer;//双缓冲区
private Shape currentShape; // 当前正在绘制的图形
List shapes = new List(); // 已经绘制的图形
bool IsDraw = false;
public MainFrom()
{
InitializeComponent();
this.buffer = new Bitmap(this.drawArea.Width this.drawArea.Height);
Graphics g = Graphics.FromImage(buffer);
g.FillRectangle(Brushes.White new Rectangle(0 0 buffer.Width buffer.Height));
}
private void MainFrom_Load(object sender EventArgs e)
{
this.saveFileDialog1.Filter = “Jpg文件|*.jpg|Gif文件|*.gif|Bmp文件|*.bmp“;
}
private void MainFrom_Paint(object sender PaintEventArgs e)
{
this.DrawShape();
}
#region 单击一个按钮,,其余的就弹起
private void GetPicType(object sender Panel p)
{
foreach (Control c in p.Controls)
{
if (c is PictureBox)
{
(c as PictureBox).Borderstyle = Borderstyle.None;
}
}
PictureBox pic = sender as PictureBox;
pic.Borderstyle = Borderstyle.Fixed3D;
}
private void GrawType_Click(object sender EventArgs e)
{
GetPicType(sender this.panel2);
int type = int.Parse((sender as PictureBox).Tag.ToString());
this.currentType = (DrawType)type;
}
private void LineType_Click(object sender EventArgs e)
{
this.GetPicType(sender this.panel3);
int type = int.Parse((sender as PictureBox).Tag.ToString());
currentLine = (LineType)type;
}
private void ColorType_Click(object sender EventArgs e)
{
this.GetPicType(sender this.panel1);
string name = (sender as PictureBox).Tag.ToString();
currentColor = Color.FromName(name);
}
#endregion
#region 绘图方法
private void DrawShape()
{
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 81920 2008-11-26 09:19 WinForm项目:小画笔\绘图\DrawShap\bin\Debug\DrawShap.exe
文件 60928 2008-11-26 09:19 WinForm项目:小画笔\绘图\DrawShap\bin\Debug\DrawShap.pdb
文件 5632 2005-12-08 14:51 WinForm项目:小画笔\绘图\DrawShap\bin\Debug\DrawShap.vshost.exe
文件 19740 2008-11-21 12:58 WinForm项目:小画笔\绘图\DrawShap\bin\Debug\Ellipse.jpg
文件 21129 2008-11-21 12:58 WinForm项目:小画笔\绘图\DrawShap\bin\Debug\Ellipse.psd
文件 19282 2008-11-21 13:00 WinForm项目:小画笔\绘图\DrawShap\bin\Debug\FillRect.jpg
文件 19624 2008-11-21 13:00 WinForm项目:小画笔\绘图\DrawShap\bin\Debug\FillRect.psd
文件 4049 2008-11-26 09:02 WinForm项目:小画笔\绘图\DrawShap\bin\Debug\hh.jpg
文件 18998 2008-11-21 12:56 WinForm项目:小画笔\绘图\DrawShap\bin\Debug\Line.jpg
文件 19512 2008-11-21 12:56 WinForm项目:小画笔\绘图\DrawShap\bin\Debug\Line.psd
文件 19560 2008-11-21 12:57 WinForm项目:小画笔\绘图\DrawShap\bin\Debug\Pen.jpg
文件 19973 2008-11-21 12:57 WinForm项目:小画笔\绘图\DrawShap\bin\Debug\Pen.psd
文件 12988 2008-11-21 14:33 WinForm项目:小画笔\绘图\DrawShap\bin\Debug\Red.bmp
文件 516 2008-11-26 08:25 WinForm项目:小画笔\绘图\DrawShap\DrawClass\DrawCircle.cs
文件 594 2008-11-26 08:25 WinForm项目:小画笔\绘图\DrawShap\DrawClass\DrawFillEllipse.cs
文件 609 2008-11-26 08:25 WinForm项目:小画笔\绘图\DrawShap\DrawClass\DrawFillRectangle.cs
文件 546 2008-11-26 08:02 WinForm项目:小画笔\绘图\DrawShap\DrawClass\DrawLine.cs
文件 1155 2008-11-26 08:49 WinForm项目:小画笔\绘图\DrawShap\DrawClass\DrawLines.cs
文件 579 2008-11-26 08:25 WinForm项目:小画笔\绘图\DrawShap\DrawClass\DrawRectangle.cs
文件 1805 2008-11-26 08:14 WinForm项目:小画笔\绘图\DrawShap\DrawClass\Shape.cs
文件 3766 2008-11-26 08:38 WinForm项目:小画笔\绘图\DrawShap\DrawShap.csproj
文件 57618 2008-11-21 13:03 WinForm项目:小画笔\绘图\DrawShap\Form1.resx
文件 15086 2007-10-12 11:35 WinForm项目:小画笔\绘图\DrawShap\icon.ico
文件 8588 2008-11-26 09:19 WinForm项目:小画笔\绘图\DrawShap\MainFrom.cs
文件 28428 2008-11-26 09:19 WinForm项目:小画笔\绘图\DrawShap\MainFrom.designer.cs
文件 54486 2008-11-26 09:19 WinForm项目:小画笔\绘图\DrawShap\MainFrom.resx
文件 845 2008-11-26 09:19 WinForm项目:小画笔\绘图\DrawShap\obj\Debug\DrawShap.csproj.GenerateResource.Cache
文件 81920 2008-11-26 09:19 WinForm项目:小画笔\绘图\DrawShap\obj\Debug\DrawShap.exe
文件 60928 2008-11-26 09:19 WinForm项目:小画笔\绘图\DrawShap\obj\Debug\DrawShap.pdb
文件 33616 2008-11-26 09:19 WinForm项目:小画笔\绘图\DrawShap\obj\Debug\Jackeyyang.DrawShap.MainFrom.resources
............此处省略25个文件信息
相关资源
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
- C# 使用ListView控件实现图片浏览器(源
- C#简单窗体聊天程序
评论
共有 条评论