文件名称:C#绘画画图
文件大小:57KB
文件格式:ZIP
更新时间:2018-12-12 03:51:56
C#画图
画图,圆形,直线,多边形,等等 Graphics gs = Graphics.FromImage(img); Pen newPen = new Pen(Color.Red, 1); if (Ept.X <= 500 && Ept.Y <= 500) { if (radioButton2.Checked)//画直线 { gs.DrawLine(newPen, Spt, Ept); } if (radioButton3.Checked)//画矩形 { gs.DrawRectangle(newPen, Spt.X, Spt.Y, Ept.X - Spt.X, Ept.Y - Spt.Y); if (Ept.X < Spt.X && Ept.Y < Spt.Y) { gs.DrawRectangle(newPen, Ept.X, Ept.Y, Spt.X - Ept.X, Spt.Y - Ept.Y); } if (Ept.X < Spt.X) { gs.DrawRectangle(newPen, Ept.X, Spt.Y, Spt.X - Ept.X, Ept.Y - Spt.Y); } if (Ept.Y < Spt.Y) { gs.DrawRectangle(newPen, Spt.X, Ept.Y, Ept.X - Spt.X, Spt.Y - Ept.Y); } } if (radioButton4.Checked)//画圆形 { gs.DrawEllipse(newPen, Spt.X, Spt.Y, Ept.X - Spt.X, Ept.Y - Spt.Y); CursorD = false; return; } if (radioButton5.Checked)//画多边型 { if (!TwoClick) { gs.DrawLine(newPen, Spt, Ept); Mpt = Ept; TwoClick = true; } else { gs.DrawLine(newPen, Mpt, Ept); Mpt = Ept; } } if (radioButton7.Checked)//画曲线 { if (TwoClick == false && DoubleClick == false) { Mpt = Ept; TwoClick = true; } if (TwoClick == true && DoubleClick == false) { DoubleClick = true; } if (TwoClick && DoubleClick) { gs.DrawBezier(newPen, Fpt, Spt, Ept, Mpt); } } CursorD = false; } else { return; }
【文件预览】:
HuaTuXiGongJu
----bin()
--------Release()
--------Debug()
----Form1.Designer.cs(8KB)
----Program.cs(492B)
----obj()
--------画图.csproj.FileList.txt(261B)
--------Debug()
----源码必读.txt(527B)
----Form1.cs(9KB)
----画图.suo(20KB)
----Form1.resx(6KB)
----画图.sln(901B)
----画图.csproj(4KB)
----Properties()
--------Resources.resx(5KB)
--------Settings.settings(249B)
--------AssemblyInfo.cs(1KB)
--------Settings.Designer.cs(1KB)
--------Resources.Designer.cs(3KB)