資源簡介
winform 項目 的 小畫筆,,采用了封裝,,繼承 面向?qū)ο?img width=510 src=http://www.sh-liguang.com/pic/99582.jpg />
代碼片段和文件信息
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;//雙緩沖區(qū)
????????private?Shape?currentShape;??//?當前正在繪制的圖形
????????List?shapes?=?new?List();??//?已經(jīng)繪制的圖形
????????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個文件信息
評論
共有 條評論