This program is used to resize images.
1 using System;
2 using System.Windows.Forms;
3 using System.Drawing;
4 using System.IO;
5 class haha
6 {
7 [STAThread]
8 static void Main()
9 {
10 string[] s=null;
11 OpenFileDialog dlg = new OpenFileDialog();
12 dlg.Filter = "|*.jpg";
13 dlg.Multiselect = true;
14 if (dlg.ShowDialog() == DialogResult.OK)
15 {
16 s = dlg.FileNames;
17 }
18 else return;
19 Bitmap bit = new Bitmap(321, 241);
20 for (int i = 0; i < s.Length; i++)
21 {
22 Graphics.FromImage(bit).DrawImage(Image.FromFile(s[i]),0,0,320,240);
23 bit.Save(i + ".png");
24 }
25 MessageBox.Show("转换成功了");
26 }
27 }