资源简介
C#数字图像处理3种典型方法:提取像素法、内存法、指针法。源代码

代码片段和文件信息
/*
* Copyright 2013 http://blog.csdn.net/fox666 https://code.csdn.net/fox666
*
* Licensed under the Apache License Version 2.0 (the “License“);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing software
* distributed under the License is distributed on an “AS IS“ BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
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;
namespace 第二章
{
public partial class Form1 : Form
{
private string curFileName;
private System.Drawing.Bitmap curBitmap;
public Form1()
{
InitializeComponent();
}
private void open_Click(object sender EventArgs e)
{
//创建OpenFileDialog
OpenFileDialog opnDlg = new OpenFileDialog();
opnDlg.Filter = “所有图像文件|*.bmp;*.pcx;*.png;*.jpg;*.gif;“ +
“*.tif;*.ico;*.dxf;*.cgm;*.cdr;*.wmf;*.eps;*.emf|“ +
“位图(*.bmp;*.jpg;*.png;...)|*.bmp;*.pcx;*.png;*.jpg;*.gif;*.tif;*.ico|“ +
“矢量图(*.wmf;*.eps;*.emf:...)|*.dxf;*.cgm;*.cdr;*.wmf;*.eps;*.emf“;
//设置对话框标题
opnDlg.title = “打开图像文件“;
//启用帮助按钮
opnDlg.ShowHelp = true;
//如果结果为打开选定文件
if (opnDlg.ShowDialog()==DialogResult.OK )
{
//读取当前选中文件名
curFileName = opnDlg.FileName;
//使用Image.
try
{
curBitmap = (Bitmap)Image.FromFile(curFileName);
}
catch ( Exception exp)
{
//抛出异常
MessageBox.Show(exp.Message);
}
//对窗体重新绘制
Invalidate();
}
}
private void save_Click(object sender EventArgs e)
{
//如果没有创建图像则退出
if (curBitmap == null)
return;
//调用SaveFileDialog
SaveFileDialog saveDlg = new SaveFileDialog();
//设置对话框标题
saveDlg.title=“保存为“;
//改写已经存在文件时提醒用户
saveDlg.OverwritePrompt = true;
//为图像选择一个筛选器
saveDlg.Filter = “BMP文件(*.bmp)|*.bmp|“ + “Gif文件(*.gif)|*.gif|“ + “Tiff文件(*.tif)|*.tif|“ +
“JPEG文件(*.jpg)|*.jpg|“ + “PNG文件(*.png)|*.png“;
//启用“帮助”按钮
saveDlg.ShowHelp = true;
//如果选择了格式,则保存图像
if (saveDlg.ShowDialog() == DialogResult.OK)
{
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
.CA.... 869 2013-12-16 16:01 第二章.sln
.CA..H. 19968 2013-12-20 21:25 第二章.suo
.CA.... 12800 2013-12-16 17:39 第二章\bin\Debug\第二章.exe
.CA.... 11600 2013-12-20 20:23 第二章\bin\Debug\第二章.vshost.exe
.CA.... 10290 2013-12-20 21:25 第二章\Form1.cs
.CA.... 5764 2013-12-20 21:25 第二章\Form1.Designer.cs
.CA.... 5817 2013-12-16 17:37 第二章\Form1.resx
.CA.... 1135 2013-12-20 21:26 第二章\Program.cs
.CA.... 1380 2013-12-16 16:01 第二章\Properties\AssemblyInfo.cs
.CA.... 2869 2013-12-16 16:01 第二章\Properties\Resources.Designer.cs
.CA.... 5612 2013-12-16 16:01 第二章\Properties\Resources.resx
.CA.... 1095 2013-12-16 16:01 第二章\Properties\Settings.Designer.cs
.CA.... 249 2013-12-16 16:01 第二章\Properties\Settings.settings
.CA.... 3899 2013-12-20 21:25 第二章\第二章.csproj
.C.D... 0 2013-12-20 21:26 第二章\bin\Debug
.C.D... 0 2013-12-16 16:01 第二章\bin
.C.D... 0 2013-12-16 16:01 第二章\Properties
.C.D... 0 2013-12-20 21:26 第二章
----------- --------- ---------- ----- ----
83347 18
相关资源
- C# TIP文件生成和拆解
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- 超市进销存管理系统 Sqlserver 数据库文
- 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# 实现的最大最小距离方法对鸢尾花
评论
共有 条评论