Click here to Skip to main content
11,417,750 members (46,598 online)
Click here to Skip to main content
Add your own
alternative version

Converting Icons to Images with a Background Worker

, 25 Oct 2010 CPOL
Using a background worker thread to execute a time consuming task
IconToImage.zip
IconToImage
bin
Debug
IconLib.dll
IconLib.pdb
IconToImage.exe
IconToImage.pdb
IconToImage.vshost.exe
Release
IconLib.dll
IconLib.pdb
IconToImage.exe
IconToImage.pdb
obj
Debug
IconToImage.csproj.GenerateResource.Cache
IconToImage.exe
IconToImage.Form1.resources
IconToImage.pdb
IconToImage.Properties.Resources.resources
Refactor
ResolveAssemblyReference.cache
TempPE
Properties.Resources.Designer.cs.dll
Release
IconToImage.csproj.GenerateResource.Cache
IconToImage.exe
IconToImage.Form1.resources
IconToImage.pdb
IconToImage.Properties.Resources.resources
TempPE
Properties.Resources.Designer.cs.dll
ProgressODoom.dll
Properties
Settings.settings
Resources
folder-open.png
image-x-generic.png
view-refresh.png
namespace IconToImage
{
    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.lstfileList = new System.Windows.Forms.ListBox();
            this.btnSelectSome = new System.Windows.Forms.Button();
            this.btnSelectFolder = new System.Windows.Forms.Button();
            this.label1 = new System.Windows.Forms.Label();
            this.rtbReport = new System.Windows.Forms.RichTextBox();
            this.pgbFile = new System.Windows.Forms.ProgressBar();
            this.btnConvert = new System.Windows.Forms.Button();
            this.pgbIcon = new System.Windows.Forms.ProgressBar();
            this.bgw = new System.ComponentModel.BackgroundWorker();
            this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
            this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
            this.SuspendLayout();
            // 
            // lstfileList
            // 
            this.lstfileList.Font = new System.Drawing.Font("Segoe UI", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lstfileList.FormattingEnabled = true;
            this.lstfileList.Location = new System.Drawing.Point(12, 12);
            this.lstfileList.Name = "lstfileList";
            this.lstfileList.Size = new System.Drawing.Size(298, 69);
            this.lstfileList.TabIndex = 0;
            // 
            // btnSelectSome
            // 
            this.btnSelectSome.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btnSelectSome.Image = global::IconToImage.Properties.Resources.image_x_generic;
            this.btnSelectSome.Location = new System.Drawing.Point(12, 87);
            this.btnSelectSome.Name = "btnSelectSome";
            this.btnSelectSome.Size = new System.Drawing.Size(128, 31);
            this.btnSelectSome.TabIndex = 1;
            this.btnSelectSome.Text = "Select some icon";
            this.btnSelectSome.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
            this.btnSelectSome.UseVisualStyleBackColor = true;
            this.btnSelectSome.Click += new System.EventHandler(this.btnSelectSome_Click);
            // 
            // btnSelectFolder
            // 
            this.btnSelectFolder.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btnSelectFolder.Image = global::IconToImage.Properties.Resources.folder_open;
            this.btnSelectFolder.Location = new System.Drawing.Point(172, 87);
            this.btnSelectFolder.Name = "btnSelectFolder";
            this.btnSelectFolder.Size = new System.Drawing.Size(138, 31);
            this.btnSelectFolder.TabIndex = 2;
            this.btnSelectFolder.Text = "Select icon\'s folder";
            this.btnSelectFolder.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
            this.btnSelectFolder.UseVisualStyleBackColor = true;
            this.btnSelectFolder.Click += new System.EventHandler(this.btnSelectFolder_Click);
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.Location = new System.Drawing.Point(146, 95);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(20, 13);
            this.label1.TabIndex = 3;
            this.label1.Text = "Or";
            // 
            // rtbReport
            // 
            this.rtbReport.Location = new System.Drawing.Point(12, 124);
            this.rtbReport.Name = "rtbReport";
            this.rtbReport.ReadOnly = true;
            this.rtbReport.Size = new System.Drawing.Size(298, 96);
            this.rtbReport.TabIndex = 4;
            this.rtbReport.Text = "";
            // 
            // pgbFile
            // 
            this.pgbFile.Location = new System.Drawing.Point(12, 233);
            this.pgbFile.Name = "pgbFile";
            this.pgbFile.Size = new System.Drawing.Size(217, 10);
            this.pgbFile.Step = 1;
            this.pgbFile.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
            this.pgbFile.TabIndex = 5;
            // 
            // btnConvert
            // 
            this.btnConvert.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btnConvert.Image = global::IconToImage.Properties.Resources.view_refresh;
            this.btnConvert.Location = new System.Drawing.Point(235, 226);
            this.btnConvert.Name = "btnConvert";
            this.btnConvert.Size = new System.Drawing.Size(75, 33);
            this.btnConvert.TabIndex = 6;
            this.btnConvert.Text = "Convert";
            this.btnConvert.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
            this.btnConvert.UseVisualStyleBackColor = true;
            this.btnConvert.Click += new System.EventHandler(this.btnConvert_Click);
            // 
            // pgbIcon
            // 
            this.pgbIcon.Location = new System.Drawing.Point(12, 249);
            this.pgbIcon.Name = "pgbIcon";
            this.pgbIcon.Size = new System.Drawing.Size(217, 10);
            this.pgbIcon.Step = 1;
            this.pgbIcon.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
            this.pgbIcon.TabIndex = 7;
            // 
            // bgw
            // 
            this.bgw.WorkerReportsProgress = true;
            this.bgw.DoWork += new System.ComponentModel.DoWorkEventHandler(this.bgw_DoWork);
            this.bgw.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.bgw_RunWorkerCompleted);
            this.bgw.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.bgw_ProgressChanged);
            // 
            // openFileDialog1
            // 
            this.openFileDialog1.FileName = "icon";
            this.openFileDialog1.Multiselect = true;
            this.openFileDialog1.Title = "select icon(s)";
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(322, 266);
            this.Controls.Add(this.pgbIcon);
            this.Controls.Add(this.btnConvert);
            this.Controls.Add(this.pgbFile);
            this.Controls.Add(this.rtbReport);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.btnSelectFolder);
            this.Controls.Add(this.btnSelectSome);
            this.Controls.Add(this.lstfileList);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.Name = "Form1";
            this.Text = "Icon to image converter";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.ListBox lstfileList;
        private System.Windows.Forms.Button btnSelectSome;
        private System.Windows.Forms.Button btnSelectFolder;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.RichTextBox rtbReport;
        private System.Windows.Forms.ProgressBar pgbFile;
        private System.Windows.Forms.Button btnConvert;
        private System.Windows.Forms.ProgressBar pgbIcon;
        private System.ComponentModel.BackgroundWorker bgw;
        private System.Windows.Forms.OpenFileDialog openFileDialog1;
        private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
    }
}

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

asugix
Engineer Donatus Inc.
Indonesia Indonesia
I'm currently a student of Brawijaya University. I work on programming just for hobby. I learn programming since 2nd year of my college. That's when I first bought my PC on year 2004.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150427.4 | Last Updated 25 Oct 2010
Article Copyright 2009 by asugix
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid