Click here to Skip to main content
Click here to Skip to main content
Articles » Multimedia » GDI+ » General » Downloads
 
Add your own
alternative version
Go to top

Building a Simple Image Conversion Utility

, 13 Sep 2006
This article describes a very easy approach to building an image conversion utility that will permit the user to open a supported image type and convert it to another supported image type.
imageconverter.zip
ImageConverter
ImageConverter
bin
Release
ImageConverter.exe
Properties
Settings.settings
namespace ImageConverter
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
            this.menuStrip1 = new System.Windows.Forms.MenuStrip();
            this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
            this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
            this.bitmapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.emfToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.exifToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.gIFFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.iconFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.jPEGFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.pNGFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.tIFFFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.windowsMetafileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
            this.menuStrip1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            this.SuspendLayout();
            // 
            // menuStrip1
            // 
            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.fileToolStripMenuItem});
            this.menuStrip1.Location = new System.Drawing.Point(0, 0);
            this.menuStrip1.Name = "menuStrip1";
            this.menuStrip1.Size = new System.Drawing.Size(577, 24);
            this.menuStrip1.TabIndex = 0;
            this.menuStrip1.Text = "menuStrip1";
            // 
            // fileToolStripMenuItem
            // 
            this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.openToolStripMenuItem,
            this.toolStripMenuItem1,
            this.toolStripMenuItem2,
            this.toolStripSeparator1,
            this.exitToolStripMenuItem});
            this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
            this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20);
            this.fileToolStripMenuItem.Text = "File";
            // 
            // openToolStripMenuItem
            // 
            this.openToolStripMenuItem.Name = "openToolStripMenuItem";
            this.openToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
            this.openToolStripMenuItem.Text = "Open...";
            this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
            // 
            // toolStripMenuItem1
            // 
            this.toolStripMenuItem1.Name = "toolStripMenuItem1";
            this.toolStripMenuItem1.Size = new System.Drawing.Size(149, 6);
            // 
            // toolStripMenuItem2
            // 
            this.toolStripMenuItem2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.bitmapToolStripMenuItem,
            this.emfToolStripMenuItem,
            this.exifToolStripMenuItem,
            this.gIFFileToolStripMenuItem,
            this.iconFileToolStripMenuItem,
            this.jPEGFileToolStripMenuItem,
            this.pNGFileToolStripMenuItem,
            this.tIFFFileToolStripMenuItem,
            this.windowsMetafileToolStripMenuItem});
            this.toolStripMenuItem2.Name = "toolStripMenuItem2";
            this.toolStripMenuItem2.Size = new System.Drawing.Size(152, 22);
            this.toolStripMenuItem2.Text = "Convert to";
            // 
            // bitmapToolStripMenuItem
            // 
            this.bitmapToolStripMenuItem.Name = "bitmapToolStripMenuItem";
            this.bitmapToolStripMenuItem.Size = new System.Drawing.Size(252, 22);
            this.bitmapToolStripMenuItem.Text = "Bitmap";
            this.bitmapToolStripMenuItem.Click += new System.EventHandler(this.bitmapToolStripMenuItem_Click);
            // 
            // emfToolStripMenuItem
            // 
            this.emfToolStripMenuItem.Name = "emfToolStripMenuItem";
            this.emfToolStripMenuItem.Size = new System.Drawing.Size(252, 22);
            this.emfToolStripMenuItem.Text = "Enhanced Windows Metafile Image";
            this.emfToolStripMenuItem.Click += new System.EventHandler(this.emfToolStripMenuItem_Click_1);
            // 
            // exifToolStripMenuItem
            // 
            this.exifToolStripMenuItem.Name = "exifToolStripMenuItem";
            this.exifToolStripMenuItem.Size = new System.Drawing.Size(252, 22);
            this.exifToolStripMenuItem.Text = "Exchangeable Image File";
            this.exifToolStripMenuItem.Click += new System.EventHandler(this.exifToolStripMenuItem_Click);
            // 
            // gIFFileToolStripMenuItem
            // 
            this.gIFFileToolStripMenuItem.Name = "gIFFileToolStripMenuItem";
            this.gIFFileToolStripMenuItem.Size = new System.Drawing.Size(252, 22);
            this.gIFFileToolStripMenuItem.Text = "GIF File";
            this.gIFFileToolStripMenuItem.Click += new System.EventHandler(this.gIFFileToolStripMenuItem_Click);
            // 
            // iconFileToolStripMenuItem
            // 
            this.iconFileToolStripMenuItem.Name = "iconFileToolStripMenuItem";
            this.iconFileToolStripMenuItem.Size = new System.Drawing.Size(252, 22);
            this.iconFileToolStripMenuItem.Text = "Icon File";
            this.iconFileToolStripMenuItem.Click += new System.EventHandler(this.iconFileToolStripMenuItem_Click);
            // 
            // jPEGFileToolStripMenuItem
            // 
            this.jPEGFileToolStripMenuItem.Name = "jPEGFileToolStripMenuItem";
            this.jPEGFileToolStripMenuItem.Size = new System.Drawing.Size(252, 22);
            this.jPEGFileToolStripMenuItem.Text = "JPEG File";
            this.jPEGFileToolStripMenuItem.Click += new System.EventHandler(this.jPEGFileToolStripMenuItem_Click);
            // 
            // pNGFileToolStripMenuItem
            // 
            this.pNGFileToolStripMenuItem.Name = "pNGFileToolStripMenuItem";
            this.pNGFileToolStripMenuItem.Size = new System.Drawing.Size(252, 22);
            this.pNGFileToolStripMenuItem.Text = "PNG File";
            this.pNGFileToolStripMenuItem.Click += new System.EventHandler(this.pNGFileToolStripMenuItem_Click);
            // 
            // tIFFFileToolStripMenuItem
            // 
            this.tIFFFileToolStripMenuItem.Name = "tIFFFileToolStripMenuItem";
            this.tIFFFileToolStripMenuItem.Size = new System.Drawing.Size(252, 22);
            this.tIFFFileToolStripMenuItem.Text = "TIFF File";
            this.tIFFFileToolStripMenuItem.Click += new System.EventHandler(this.tIFFFileToolStripMenuItem_Click);
            // 
            // windowsMetafileToolStripMenuItem
            // 
            this.windowsMetafileToolStripMenuItem.Name = "windowsMetafileToolStripMenuItem";
            this.windowsMetafileToolStripMenuItem.Size = new System.Drawing.Size(252, 22);
            this.windowsMetafileToolStripMenuItem.Text = "Windows Metafile";
            this.windowsMetafileToolStripMenuItem.Click += new System.EventHandler(this.windowsMetafileToolStripMenuItem_Click);
            // 
            // toolStripSeparator1
            // 
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6);
            // 
            // exitToolStripMenuItem
            // 
            this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
            this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
            this.exitToolStripMenuItem.Text = "Exit";
            this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
            // 
            // pictureBox1
            // 
            this.pictureBox1.BackColor = System.Drawing.Color.White;
            this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox1.Location = new System.Drawing.Point(0, 24);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(577, 439);
            this.pictureBox1.TabIndex = 1;
            this.pictureBox1.TabStop = false;
            // 
            // openFileDialog1
            // 
            this.openFileDialog1.FileName = "openFileDialog1";
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 14F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(577, 463);
            this.Controls.Add(this.pictureBox1);
            this.Controls.Add(this.menuStrip1);
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MainMenuStrip = this.menuStrip1;
            this.Name = "Form1";
            this.Text = "Image Converter";
            this.menuStrip1.ResumeLayout(false);
            this.menuStrip1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.MenuStrip menuStrip1;
        private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
        private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
        private System.Windows.Forms.ToolStripMenuItem bitmapToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem emfToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem exifToolStripMenuItem;
        private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
        private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
        private System.Windows.Forms.PictureBox pictureBox1;
        private System.Windows.Forms.OpenFileDialog openFileDialog1;
        private System.Windows.Forms.ToolStripMenuItem gIFFileToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem iconFileToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem jPEGFileToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem pNGFileToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem tIFFFileToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem windowsMetafileToolStripMenuItem;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

salysle
Software Developer (Senior)
United States United States
No Biography provided

| Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 13 Sep 2006
Article Copyright 2006 by salysle
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid