C# Image Resizer
2015-11-04 16:07
330 查看
This program is used to resize images.
using System; using System.Windows.Forms; using System.Drawing; using System.IO; class haha { [STAThread] static void Main() { string[] s=null; OpenFileDialog dlg = new OpenFileDialog(); dlg.Filter = "|*.jpg"; dlg.Multiselect = true; if (dlg.ShowDialog() == DialogResult.OK) { s = dlg.FileNames; } else return; Bitmap bit = new Bitmap(321, 241); for (int i = 0; i < s.Length; i++) { Graphics.FromImage(bit).DrawImage(Image.FromFile(s[i]),0,0,320,240); bit.Save(i + ".png"); } MessageBox.Show("转换成功了"); } }
相关文章推荐
- C# Image Resizer
- C#中Dictionary的用法及用途(转)
- C#使用ConditionalAttribute特性来实现代码调试
- C# 使用lock关键字lock不同的对象
- C# 委托delegate 例子
- C# greedy snake source code
- (c#)不同窗体间传值
- AutoCAD.Net/C#.Net QQ群:193522571 AutoCAD向命令栏发送命令
- AutoCAD.Net/C#.Net QQ群:193522571 AutoCAD中状态栏
- C# Tast 随笔
- C# DEBUG 调试信息打印及输出详解
- 2015-11-04 报表(c#部分)(Datatable 查询,弹出日期控件,输入是否整数)
- c#写windows服务
- C#占位符和格式化字符串
- C# 委托实例(跨窗体操作控件)
- C#实现程序的版本升级更新
- C#中通过Selenium定位<a>标签的问题
- C# WinFrom 去掉groupbox的边框
- c# 换行符
- c# WinForm 创建与读写配置文件