資源簡介
C# 畫圖程序C# 畫圖程序C# 畫圖程序C# 畫圖程序C# 畫圖程序C# 畫圖程序C# 畫圖程序

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
using?System.Drawing.Imaging;
using?System.IO;
namespace?畫圖
{
????public?partial?class?Form1?:?Form
????{
????????Graphics?g;
????????Pen?pen;
????????Point?pt;
????????Point?pt1;
????????Point?pt2;
????????string?lx;
????????string?dw;
????????Bitmap?bmp;
????????
????
???????
??????
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????g?=?panel1.CreateGraphics();
????????????pen?=?new?Pen(Color.Black?1);
????????????pen.Width?=?1;
????????????lx?=?“zhixian“;
????????}
????????private?void?radioButton1_CheckedChanged(object?sender?EventArgs?e)
????????{
????????????pen.Color?=?Color.Red;
????????}
????????private?void?radioButton2_CheckedChanged(object?sender?EventArgs?e)
????????{
????????????pen.Color?=?Color.Yellow;
????????}
????????private?void?radioButton3_CheckedChanged(object?sender?EventArgs?e)
????????{
????????????pen.Color?=?Color.Blue;
????????}
????????private?void?radioButton4_CheckedChanged(object?sender?EventArgs?e)
????????{
????????????pen.Width?=?1;
????????}
????????private?void?radioButton5_CheckedChanged(object?sender?EventArgs?e)
????????{
????????????pen.Width?=?5;
????????}
????????private?void?radioButton6_CheckedChanged(object?sender?EventArgs?e)
????????{
????????????pen.Width?=?10;
????????}
????????private?void?panel1_MouseDown(object?sender?MouseEventArgs?e)
????????{
????????????pt1?=?Cursor.Position;
????????????pt=pt1?=?this.PointToClient(pt1);
????????????dw?=?“down“;
????????}
????????private?void?panel1_MouseUp(object?sender?MouseEventArgs?e)
????????{
????????????pt2?=?Cursor.Position;
????????????pt2?=?this.PointToClient(pt2);
????????????dw?=?“up“;
????????????switch?(lx)
????????????{
????????????????case?“zhixian“:?g.DrawLine(pen?pt1?pt2);?dw?=?“up“;?break;
????????????????case?“juxing“:?g.DrawRectangle(pen?new?Rectangle(pt1.X?pt1.Y?pt2.X?pt2.Y));?dw?=?“up“;?break;
????????????????case?“tuoyuan“:?g.DrawEllipse(pen?new?Rectangle(pt1.X?pt1.Y?pt2.X?pt2.Y));?dw?=?“up“;?break;
????????????}
????????????//
????????????Point?screenLocation?=?PointToScreen(panel1.Location);
????????????bmp?=?new?Bitmap(panel1.Width?panel1.Height);
????????????Graphics?ge?=?Graphics.FromImage(bmp);
????????????ge.CopyFromScreen(new?Point(screenLocation.X?screenLocation.Y)?new?Point(panel1.Location.X?-?165?panel1.Location.Y?-?5)?new?Size(panel1.Width?panel1.Height));??????
????????????//
????????}
????????private?void?panel1_MouseMove(object?sender?MouseEventArgs?e)
????????{
????????????if?(lx?==?“lianxuxian“&&dw==“down“)
????????????{
????????????????g.DrawLine(pen?pt?new?Point(e.X?e.Y
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2011-10-26?12:38??畫圖\
?????目錄???????????0??2011-10-26?12:38??畫圖\畫圖\
?????文件?????????860??2011-10-20?15:34??畫圖\畫圖.sln
?????文件???????16384??2011-10-27?23:27??畫圖\畫圖.suo
?????目錄???????????0??2011-10-26?12:38??畫圖\畫圖\bin\
?????目錄???????????0??2011-10-26?12:38??畫圖\畫圖\bin\Debug\
?????目錄???????????0??2011-10-20?19:52??畫圖\畫圖\bin\Debug\Screenshots\
?????文件???????14848??2011-10-25?21:25??畫圖\畫圖\bin\Debug\畫圖.exe
?????文件???????34304??2011-10-25?21:25??畫圖\畫圖\bin\Debug\畫圖.pdb
?????文件???????11608??2011-10-27?23:27??畫圖\畫圖\bin\Debug\畫圖.vshost.exe
?????文件?????????490??2010-03-17?22:39??畫圖\畫圖\bin\Debug\畫圖.vshost.exe.manifest
?????文件????????5141??2011-10-25?21:25??畫圖\畫圖\Form1.cs
?????文件???????13350??2011-10-25?21:25??畫圖\畫圖\Form1.Designer.cs
?????文件????????5990??2011-10-25?21:25??畫圖\畫圖\Form1.resx
?????目錄???????????0??2011-10-26?12:38??畫圖\畫圖\obj\
?????目錄???????????0??2011-10-26?12:38??畫圖\畫圖\obj\x86\
?????目錄???????????0??2011-10-26?12:38??畫圖\畫圖\obj\x86\Debug\
?????文件????????6020??2011-10-27?23:26??畫圖\畫圖\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件?????????522??2011-10-25?21:25??畫圖\畫圖\obj\x86\Debug\GenerateResource-ResGen.read.1.tlog
?????文件?????????526??2011-10-25?21:25??畫圖\畫圖\obj\x86\Debug\GenerateResource-ResGen.write.1.tlog
?????目錄???????????0??2011-10-20?15:33??畫圖\畫圖\obj\x86\Debug\TempPE\
?????文件?????????931??2011-10-27?23:27??畫圖\畫圖\obj\x86\Debug\畫圖.csproj.FileListAbsolute.txt
?????文件???????14848??2011-10-25?21:25??畫圖\畫圖\obj\x86\Debug\畫圖.exe
?????文件?????????180??2011-10-25?21:25??畫圖\畫圖\obj\x86\Debug\畫圖.Form1.resources
?????文件???????34304??2011-10-25?21:25??畫圖\畫圖\obj\x86\Debug\畫圖.pdb
?????文件?????????180??2011-10-20?15:48??畫圖\畫圖\obj\x86\Debug\畫圖.Properties.Resources.resources
?????文件?????????487??2011-10-20?15:33??畫圖\畫圖\Program.cs
?????目錄???????????0??2011-10-26?12:38??畫圖\畫圖\Properties\
?????文件????????1344??2011-10-20?15:33??畫圖\畫圖\Properties\AssemblyInfo.cs
?????文件????????2862??2011-10-20?15:33??畫圖\畫圖\Properties\Resources.Designer.cs
?????文件????????5612??2011-10-20?15:33??畫圖\畫圖\Properties\Resources.resx
............此處省略3個文件信息
評論
共有 條評論