资源简介
用C#在winform画多边形,图片可以保存,读取显示!

代码片段和文件信息
using System;
using System.Collections;
using System.Drawing;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Imaging;
namespace DrawPolygon
{
///
/// 作者: WQ
///
public class DrawClass
{
public DrawClass()
{ }
///
/// 在Windows控件两坐标间画线
///
/// Windows控件
/// 坐标1
/// 坐标2
/// 线颜色
public static void DrawLine(Control control Point pt1 Point pt2 Color color)
{
Graphics gfx = control.CreateGraphics();
gfx.DrawLine(new Pen(color) pt1 pt2);
}
///
/// 在Windows控件坐标点画十字
///
/// Windows控件
/// 坐标
/// 线颜色
public static void DrawCross(Control control Point pt Color color)
{
Graphics gfx = control.CreateGraphics();
Point startPt = new Point(pt.X - 2 pt.Y);
Point endPt = new Point(pt.X + 2 pt.Y);
gfx.DrawLine(new Pen(color) startPt endPt);
startPt = new Point(pt.X pt.Y - 2);
endPt = new Point(pt.X pt.Y + 2);
gfx.DrawLine(new Pen(color) startPt endPt);
}
///
/// 画多边形图
///
/// 坐标点集合
/// 图颜色
///
public static Bitmap CreatImage(Point[] ptsColor color)
{
Bitmap newBitmap = new Bitmap(600 400 PixelFormat.Format32bppArgb);
Graphics g = Graphics.FromImage(newBitmap);
g.DrawPolygon(new Pen(color) pts);
return newBitmap;
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 14848 2011-04-24 14:41 DrawPolygon\bin\Debug\DrawPolygon.exe
文件 34304 2011-04-24 14:41 DrawPolygon\bin\Debug\DrawPolygon.pdb
文件 14328 2011-04-24 14:44 DrawPolygon\bin\Debug\DrawPolygon.vshost.exe
文件 5524 2011-04-21 14:18 DrawPolygon\bin\Debug\test.jpg
文件 2156 2011-04-21 14:09 DrawPolygon\DrawClass.cs
文件 3853 2011-04-24 14:41 DrawPolygon\DrawPolygon.csproj
文件 911 2011-04-24 14:21 DrawPolygon\DrawPolygon.sln
..A..H. 16384 2011-04-24 14:44 DrawPolygon\DrawPolygon.suo
文件 5452 2011-04-24 14:22 DrawPolygon\frmDrawPolygon.cs
文件 8189 2011-04-24 14:22 DrawPolygon\frmDrawPolygon.Designer.cs
文件 8867 2011-04-24 14:22 DrawPolygon\frmDrawPolygon.resx
文件 1098 2011-04-24 14:44 DrawPolygon\obj\Debug\DrawPolygon.csproj.FileListAbsolute.txt
文件 914 2011-04-24 14:41 DrawPolygon\obj\Debug\DrawPolygon.csproj.GenerateResource.Cache
文件 14848 2011-04-24 14:41 DrawPolygon\obj\Debug\DrawPolygon.exe
文件 2014 2011-04-24 14:41 DrawPolygon\obj\Debug\DrawPolygon.frmDrawPolygon.resources
文件 34304 2011-04-24 14:41 DrawPolygon\obj\Debug\DrawPolygon.pdb
文件 180 2011-04-24 14:41 DrawPolygon\obj\Debug\DrawPolygon.Properties.Resources.resources
文件 501 2011-04-21 11:42 DrawPolygon\Program.cs
文件 1378 2011-04-20 12:40 DrawPolygon\Properties\AssemblyInfo.cs
文件 2872 2011-04-20 12:40 DrawPolygon\Properties\Resources.Designer.cs
文件 5612 2011-04-20 12:40 DrawPolygon\Properties\Resources.resx
文件 1096 2011-04-20 12:40 DrawPolygon\Properties\Settings.Designer.cs
文件 249 2011-04-20 12:40 DrawPolygon\Properties\Settings.settings
目录 0 2011-04-22 14:13 DrawPolygon\obj\Debug\Refactor
目录 0 2011-04-22 14:13 DrawPolygon\obj\Debug\TempPE
目录 0 2011-04-24 14:41 DrawPolygon\bin\Debug
目录 0 2011-04-24 14:41 DrawPolygon\obj\Debug
目录 0 2011-04-24 14:40 DrawPolygon\bin
目录 0 2011-04-22 14:13 DrawPolygon\obj
目录 0 2011-04-22 14:13 DrawPolygon\Properties
............此处省略4个文件信息
- 上一篇:中兴华为C#编码规范
- 下一篇:C#中读取Excel表格数据
相关资源
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- Winform可视化打印模板设计工具含源码
- 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#简单窗体聊天程序
- C#指纹识别系统程序 报告
评论
共有 条评论