QuickImage – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Diagnostics;
6 using System.Drawing;
7 using System.Drawing.Imaging;
8 using System.IO;
9 using System.Text;
10 using System.Windows.Forms;
11  
12 namespace CraftSynth.ImageEditor.Gui
13 {
14 public partial class Form1 : Form
15 {
16 public Form1()
17 {
18 InitializeComponent();
19 this.imageEditor1.ParentForm = this;
20 }
21  
22 private void tsmiImport_Click(object sender, EventArgs e)
23 {
24 if (DialogResult.OK == this.openFileDialog1.ShowDialog(this))
25 {
26 this.imageEditor1.ReplaceInitialImage(Image.FromFile(this.openFileDialog1.FileName), false, true);
27 }
28 }
29  
30 private void tsmiExport_Click(object sender, EventArgs e)
31 {
32 if (DialogResult.OK == this.saveFileDialog1.ShowDialog(this))
33 {
34 string ext = Path.GetExtension(this.saveFileDialog1.FileName).ToLower().TrimStart('.');
35 ImageFormat format = ImageFormat.Bmp;
36 switch (ext)
37 {
38 case "jpg": format = ImageFormat.Jpeg; break;
39 case "jpeg": format = ImageFormat.Jpeg; break;
40 case "png": format = ImageFormat.Png; break;
41 case "gif": format = ImageFormat.Gif; break;
42 }
43 this.imageEditor1.ExportToFile(this.saveFileDialog1.FileName, format);
44 }
45 }
46  
47 private void tsmiExit_Click(object sender, EventArgs e)
48 {
49 this.Close();
50 }
51  
52 private void tsmiAbout_Click(object sender, EventArgs e)
53 {
54 Process process = new Process();
55 process.StartInfo.UseShellExecute = true;
56 process.StartInfo.FileName = "http://www.f4cio.com/Image-Editor-Control-For-WinForms";
57 process.Start();
58 }
59 }
60 }