您的位置:首页 > 教程 > C#教程 > 利用C#实现批量图片格式转换功能

利用C#实现批量图片格式转换功能

2022-12-09 12:09:09 来源:易采站长站 作者:

目录实践过程效果代码实践过程效果代码publicpartialclassForm1:Form{publicForm1(){InitializeCompone...

目录
实践过程
效果
代码

实践过程

效果

利用C#实现批量图片格式转换功能

代码

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    string[] path1 = null; //用于存储选择的文件列表
    string path2 = ""; //用于存储保存的路径
    Bitmap bt; //声明一个转换图片格式的Bitmap对象
    Thread td; //声明一个线程
    int Imgtype1; //声明一个变量用于标记ConvertImage方法中转换的类型
    string OlePath; //声明一个变量用于存储ConvertImage方法中原始图片的路径
    string path; //声明一个变量用于存储ConvertImage方法中转换后图片的保存路径
    int flags; //用于标记已转换图片的数量,用于计算转换进度

    private void Form2_Load(object sender, EventArgs e)
    {
        tscbType.SelectedIndex = 0; //设置第一个转换类型被选中
        CheckForIllegalCrossThreadCalls = false; //屏蔽线程弹出的错误提示
    }

    private void toolStripButton3_Click(object sender, EventArgs e) //选择转换文件的按钮
    {
        if (openFileDialog1.ShowDialog() == DialogResult.OK) //判断是否选择文件
        {
            listView1.Items.Clear(); //清空listView1
            string[] info = new string[7]; //存储每一行数据
            FileInfo fi; //创建一个FileInfo对象,用于获取图片信息
            path1 = openFileDialog1.FileNames; //获取选择的图片集合
            for (int i = 0; i < path1.Length; i++) //读取集合中的内容
            {
                //获取图片名称
                string ImgName = path1[i].Substring(path1[i].LastIndexOf("\\") + 1,
                    path1[i].Length - path1[i].LastIndexOf("\\") - 1);
                //获取图片类型
                string ImgType = ImgName.Substring(ImgName.LastIndexOf(".") + 1,
                    ImgName.Length - ImgName.LastIndexOf(".") - 1);
                fi = new FileInfo(path1[i].ToString()); //实例化FileInfo对象
                //将每一行数据第一个位置的图标添加到imageList1中
                imageList1.Images.Add(ImgName, Properties.Resources.图标__23_);
                info[1] = ImgName; //图片名称
                info[2] = ImgType; //图片类型
                info[3] = fi.LastWriteTime.ToShortDateString(); //图片最后修改日期
                info[4] = path1[i].ToString(); //图片位置
                info[5] = (fi.Length / 1024) + "KB"; //图片大小
                info[6] = "未转换"; //图片状态
                ListViewItem lvi = new ListViewItem(info, ImgName); //实例化ListViewItem对象
                listView1.Items.Add(lvi); //将信息添加到listView1控件中
            }

            tsslFileNum.Text = "当前共有" + path1.Length.ToString() + "个文件"; //状态栏中显示图片数量
        }
    }

    private void toolStripButton2_Click(object sender, EventArgs e) //关闭按钮
    {
        Application.Exit(); //退出系统
    }

    private void toolStripButton5_Click(object sender, EventArgs e) //清空列表的按钮
    {
        listView1.Items.Clear(); //清空列表
        path1 = null; //清空图片的集合
        tsslFileNum.Text = "当前没有文件"; //状态栏中提示
        tsslPlan.Text = ""; //清空进度数字
    }

    private void toolStripButton1_Click(object sender, EventArgs e)
    {
        if (path1 == null) //判断是否选择图片
        {
            MessageBox.Show("请选择图片!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        else
        {
            if (path2.Length == 0) //判断是否选择保存位置
            {
                MessageBox.Show("请选择保存位置!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                flags = 1; //初始化flags变量为1,用于计算进度
                toolStrip1.Enabled = false; //当转换开始时,禁用工具栏
                int flag = tscbType.SelectedIndex; //判断将图片转换为何种格式
                switch (flag) //根据不同的格式进行转换
                {
                    case 0:
                        Imgtype1 = 0; //如果选择第一项则转换为BMP格式
                        td = new Thread(new ThreadStart(ConvertImage)); //通过线程调用ConvertImage方法进行转换
                        td.Start();
                        break;
                    case 1: //如果选择第二项则转换为JPG格式
                        Imgtype1 = 1;
                        td = new Thread(new ThreadStart(ConvertImage)); //通过线程调用ConvertImage方法进行转换
                        td.Start();
                        break;
                    case 2: //如果选择第三项则转换为PNG格式
                        Imgtype1 = 2;
                        td = new Thread(new ThreadStart(ConvertImage)); //通过线程调用ConvertImage方法进行转换
                        td.Start();
                        break;
                    case 3: //如果选择第四项则转换为GIF格式
                        Imgtype1 = 3;
                        td = new Thread(new ThreadStart(ConvertImage)); //通过线程调用ConvertImage方法进行转换
                        td.Start();
                        break;
                    default:
                        td.Abort();
                        break;
                }
            }
        }
    }

    private void toolStripButton4_Click(object sender, EventArgs e) //选择保存路径按钮
    {
        if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) //判断是否选择保存路径
        {
            path2 = folderBrowserDialog1.SelectedPath; //获取保存路径
        }
    }

    private void ConvertImage()
    {
        flags = 1;
        switch (Imgtype1)
        {
            case 0:
                for (int i = 0; i < path1.Length; i++)
                {
                    string ImgName = path1[i].Substring(path1[i].LastIndexOf("\\") + 1,
                        path1[i].Length - path1[i].LastIndexOf("\\") - 1);
                    ImgName = ImgName.Remove(ImgName.LastIndexOf("."));
                    OlePath = path1[i].ToString();
                    bt = new Bitmap(OlePath);
                    path = path2 + "\\" + ImgName + ".bmp";
                    bt.Save(path, System.Drawing.Imaging.ImageFormat.Bmp);
                    listView1.Items[flags - 1].SubItems[6].Text = "已转换";
                    tsslPlan.Text = "正在转换" + flags * 100 / path1.Length + "%";
                    if (flags == path1.Length)
                    {
                        toolStrip1.Enabled = true;
                        tsslPlan.Text = "图片转换全部完成";
                    }

                    flags++;
                }

                break;
            case 1:
                for (int i = 0; i < path1.Length; i++)
                {
                    string ImgName = path1[i].Substring(path1[i].LastIndexOf("\\") + 1,
                        path1[i].Length - path1[i].LastIndexOf("\\") - 1);
                    ImgName = ImgName.Remove(ImgName.LastIndexOf("."));
                    OlePath = path1[i].ToString();
                    bt = new Bitmap(OlePath);
                    path = path2 + "\\" + ImgName + ".jpeg";
                    bt.Save(path, System.Drawing.Imaging.ImageFormat.Jpeg);
                    listView1.Items[flags - 1].SubItems[6].Text = "已转换";
                    tsslPlan.Text = "正在转换" + flags * 100 / path1.Length + "%";
                    if (flags == path1.Length)
                    {
                        toolStrip1.Enabled = true;
                        tsslPlan.Text = "图片转换全部完成";
                    }

                    flags++;
                }

                break;
            case 2:
                for (int i = 0; i < path1.Length; i++)
                {
                    string ImgName = path1[i].Substring(path1[i].LastIndexOf("\\") + 1,
                        path1[i].Length - path1[i].LastIndexOf("\\") - 1);
                    ImgName = ImgName.Remove(ImgName.LastIndexOf("."));
                    OlePath = path1[i].ToString();
                    bt = new Bitmap(OlePath);
                    path = path2 + "\\" + ImgName + ".png";
                    bt.Save(path, System.Drawing.Imaging.ImageFormat.Png);
                    listView1.Items[flags - 1].SubItems[6].Text = "已转换";
                    tsslPlan.Text = "正在转换" + flags * 100 / path1.Length + "%";
                    if (flags == path1.Length)
                    {
                        toolStrip1.Enabled = true;
                        tsslPlan.Text = "图片转换全部完成";
                    }

                    flags++;
                }

                break;
            case 3:
                for (int i = 0; i < path1.Length; i++)
                {
                    string ImgName = path1[i].Substring(path1[i].LastIndexOf("\\") + 1,
                        path1[i].Length - path1[i].LastIndexOf("\\") - 1);
                    ImgName = ImgName.Remove(ImgName.LastIndexOf("."));
                    OlePath = path1[i].ToString();
                    bt = new Bitmap(OlePath);
                    path = path2 + "\\" + ImgName + ".gif";
                    bt.Save(path, System.Drawing.Imaging.ImageFormat.Gif);
                    listView1.Items[flags - 1].SubItems[6].Text = "已转换";
                    tsslPlan.Text = "正在转换" + flags * 100 / path1.Length + "%";
                    if (flags == path1.Length)
                    {
                        toolStrip1.Enabled = true;
                        tsslPlan.Text = "图片转换全部完成";
                    }

                    flags++;
                }

                break;
            default:
                bt.Dispose();
                break;
        }
    }

    private void Form2_FormClosed(object sender, FormClosedEventArgs e) //关闭窗口时要关闭线程
    {
        if (td != null) //判断是否存在线程
        {
            if (td.ThreadState == ThreadState.Running) //然后判断线程是否正在运行
            {
                td.Abort(); //如果运行则关闭线程
            }
        }
    }
}
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()
    {
        this.components = new System.ComponentModel.Container();
        System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
        this.toolStrip1 = new System.Windows.Forms.ToolStrip();
        this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
        this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
        this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
        this.toolStripButton4 = new System.Windows.Forms.ToolStripButton();
        this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
        this.toolStripLabel3 = new System.Windows.Forms.ToolStripLabel();
        this.tscbType = new System.Windows.Forms.ToolStripComboBox();
        this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
        this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
        this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
        this.toolStripButton5 = new System.Windows.Forms.ToolStripButton();
        this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
        this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
        this.statusStrip1 = new System.Windows.Forms.StatusStrip();
        this.tsslFileNum = new System.Windows.Forms.ToolStripStatusLabel();
        this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
        this.tsslPlan = new System.Windows.Forms.ToolStripStatusLabel();
        this.listView1 = new System.Windows.Forms.ListView();
        this.columnHeader6 = new System.Windows.Forms.ColumnHeader();
        this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
        this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
        this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
        this.columnHeader4 = new System.Windows.Forms.ColumnHeader();
        this.columnHeader5 = new System.Windows.Forms.ColumnHeader();
        this.columnHeader7 = new System.Windows.Forms.ColumnHeader();
        this.imageList1 = new System.Windows.Forms.ImageList(this.components);
        this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
        this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
        this.toolStrip1.SuspendLayout();
        this.statusStrip1.SuspendLayout();
        this.SuspendLayout();
        // 
        // toolStrip1
        // 
        this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
        this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
        this.toolStripLabel1,
        this.toolStripButton3,
        this.toolStripSeparator1,
        this.toolStripButton4,
        this.toolStripSeparator2,
        this.toolStripLabel3,
        this.tscbType,
        this.toolStripSeparator3,
        this.toolStripButton1,
        this.toolStripSeparator4,
        this.toolStripButton5,
        this.toolStripSeparator5,
        this.toolStripButton2});
        this.toolStrip1.Location = new System.Drawing.Point(0, 0);
        this.toolStrip1.Name = "toolStrip1";
        this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
        this.toolStrip1.Size = new System.Drawing.Size(536, 25);
        this.toolStrip1.TabIndex = 0;
        this.toolStrip1.Text = "toolStrip1";
        // 
        // toolStripLabel1
        // 
        this.toolStripLabel1.Name = "toolStripLabel1";
        this.toolStripLabel1.Size = new System.Drawing.Size(17, 22);
        this.toolStripLabel1.Text = "  ";
        // 
        // toolStripButton3
        // 
        this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
        this.toolStripButton3.Image = global::PictureBATchConversion.Properties.Resources.打开;
        this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
        this.toolStripButton3.Name = "toolStripButton3";
        this.toolStripButton3.Size = new System.Drawing.Size(23, 22);
        this.toolStripButton3.Text = "toolStripButton3";
        this.toolStripButton3.ToolTipText = "选择需要转换的图片";
        this.toolStripButton3.Click += new System.EventHandler(this.toolStripButton3_Click);
        // 
        // toolStripSeparator1
        // 
        this.toolStripSeparator1.Name = "toolStripSeparator1";
        this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
        // 
        // toolStripButton4
        // 
        this.toolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
        this.toolStripButton4.Image = global::PictureBatchConversion.Properties.Resources.图标__29_;
        this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta;
        this.toolStripButton4.Name = "toolStripButton4";
        this.toolStripButton4.Size = new System.Drawing.Size(23, 22);
        this.toolStripButton4.Text = "toolStripButton4";
        this.toolStripButton4.TextImageRelation = System.Windows.Forms.TextImageRelation.Overlay;
        this.toolStripButton4.ToolTipText = "选择保存位置";
        this.toolStripButton4.Click += new System.EventHandler(this.toolStripButton4_Click);
        // 
        // toolStripSeparator2
        // 
        this.toolStripSeparator2.Name = "toolStripSeparator2";
        this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
        // 
        // toolStripLabel3
        // 
        this.toolStripLabel3.Name = "toolStripLabel3";
        this.toolStripLabel3.Size = new System.Drawing.Size(65, 22);
        this.toolStripLabel3.Text = "转换格式:";
        // 
        // tscbType
        // 
        this.tscbType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
        this.tscbType.FlatStyle = System.Windows.Forms.FlatStyle.System;
        this.tscbType.Items.AddRange(new object[] {
        "转换为BMP格式",
        "转换为JPG格式",
        "转换为PNG格式",
        "转换为GIF格式"});
        this.tscbType.Name = "tscbType";
        this.tscbType.Size = new System.Drawing.Size(121, 25);
        // 
        // toolStripSeparator3
        // 
        this.toolStripSeparator3.Name = "toolStripSeparator3";
        this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);
        // 
        // toolStripButton1
        // 
        this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
        this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
        this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
        this.toolStripButton1.Name = "toolStripButton1";
        this.toolStripButton1.Size = new System.Drawing.Size(57, 22);
        this.toolStripButton1.Text = "开始转换";
        this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click);
        // 
        // toolStripSeparator4
        // 
        this.toolStripSeparator4.Name = "toolStripSeparator4";
        this.toolStripSeparator4.Size = new System.Drawing.Size(6, 25);
        // 
        // toolStripButton5
        // 
        this.toolStripButton5.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
        this.toolStripButton5.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton5.Image")));
        this.toolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta;
        this.toolStripButton5.Name = "toolStripButton5";
        this.toolStripButton5.Size = new System.Drawing.Size(57, 22);
        this.toolStripButton5.Text = "清空列表";
        this.toolStripButton5.Click += new System.EventHandler(this.toolStripButton5_Click);
        // 
        // toolStripSeparator5
        // 
        this.toolStripSeparator5.Name = "toolStripSeparator5";
        this.toolStripSeparator5.Size = new System.Drawing.Size(6, 25);
        // 
        // toolStripButton2
        // 
        this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
        this.toolStripButton2.Font = new System.Drawing.Font("宋体", 9F);
        this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image")));
        this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
        this.toolStripButton2.Name = "toolStripButton2";
        this.toolStripButton2.Size = new System.Drawing.Size(33, 22);
        this.toolStripButton2.Text = "关闭";
        this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click);
        // 
        // statusStrip1
        // 
        this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
        this.tsslFileNum,
        this.toolStripStatusLabel1,
        this.tsslPlan});
        this.statusStrip1.Location = new System.Drawing.Point(0, 321);
        this.statusStrip1.Name = "statusStrip1";
        this.statusStrip1.Size = new System.Drawing.Size(536, 22);
        this.statusStrip1.TabIndex = 1;
        this.statusStrip1.Text = "statusStrip1";
        // 
        // tsslFileNum
        // 
        this.tsslFileNum.Name = "tsslFileNum";
        this.tsslFileNum.Size = new System.Drawing.Size(0, 17);
        // 
        // toolStripStatusLabel1
        // 
        this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
        this.toolStripStatusLabel1.Size = new System.Drawing.Size(23, 17);
        this.toolStripStatusLabel1.Text = "   ";
        // 
        // tsslPlan
        // 
        this.tsslPlan.Name = "tsslPlan";
        this.tsslPlan.Size = new System.Drawing.Size(0, 17);
        // 
        // listView1
        // 
        this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
        this.columnHeader6,
        this.columnHeader1,
        this.columnHeader2,
        this.columnHeader3,
        this.columnHeader4,
        this.columnHeader5,
        this.columnHeader7});
        this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
        this.listView1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
        this.listView1.FullRowSelect = true;
        this.listView1.GridLines = true;
        this.listView1.Location = new System.Drawing.Point(0, 25);
        this.listView1.Name = "listView1";
        this.listView1.Size = new System.Drawing.Size(536, 296);
        this.listView1.SmallImageList = this.imageList1;
        this.listView1.TabIndex = 2;
        this.listView1.UseCompatibleStateImageBehavior = false;
        this.listView1.View = System.Windows.Forms.View.Details;
        // 
        // columnHeader6
        // 
        this.columnHeader6.Text = "";
        this.columnHeader6.Width = 20;
        // 
        // columnHeader1
        // 
        this.columnHeader1.Text = "文件名";
        this.columnHeader1.Width = 120;
        // 
        // columnHeader2
        // 
        this.columnHeader2.Text = "扩展名";
        // 
        // columnHeader3
        // 
        this.columnHeader3.Text = "日期";
        this.columnHeader3.Width = 80;
        // 
        // columnHeader4
        // 
        this.columnHeader4.Text = "路径";
        this.columnHeader4.Width = 120;
        // 
        // columnHeader5
        // 
        this.columnHeader5.Text = "大小";
        this.columnHeader5.Width = 70;
        // 
        // columnHeader7
        // 
        this.columnHeader7.Text = "状态";
        // 
        // imageList1
        // 
        this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
        this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
        this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
        // 
        // openFileDialog1
        // 
        this.openFileDialog1.Filter = "所有图片|*.jpg;*.jpeg;*.gif;*.bmp;*.png";
        this.openFileDialog1.Multiselect = true;
        // 
        // Form2
        // 
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.ClientSize = new System.Drawing.Size(536, 343);
        this.Controls.Add(this.listView1);
        this.Controls.Add(this.statusStrip1);
        this.Controls.Add(this.toolStrip1);
        this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
        this.MaximizeBox = false;
        this.Name = "Form2";
        this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
        this.Text = "批量图片格式转换";
        this.Load += new System.EventHandler(this.Form2_Load);
        this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Form2_FormClosed);
        this.toolStrip1.ResumeLayout(false);
        this.toolStrip1.PerformLayout();
        this.statusStrip1.ResumeLayout(false);
        this.statusStrip1.PerformLayout();
        this.ResumeLayout(false);
        this.PerformLayout();

    }

    #endregion

    private System.Windows.Forms.ToolStrip toolStrip1;
    private System.Windows.Forms.StatusStrip statusStrip1;
    private System.Windows.Forms.ListView listView1;
    private System.Windows.Forms.ToolStripLabel toolStripLabel1;
    private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
    private System.Windows.Forms.ToolStripLabel toolStripLabel3;
    private System.Windows.Forms.ToolStripComboBox tscbType;
    private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
    private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
    private System.Windows.Forms.ToolStripButton toolStripButton1;
    private System.Windows.Forms.ToolStripButton toolStripButton2;
    private System.Windows.Forms.ColumnHeader columnHeader1;
    private System.Windows.Forms.ColumnHeader columnHeader2;
    private System.Windows.Forms.ColumnHeader columnHeader3;
    private System.Windows.Forms.ColumnHeader columnHeader4;
    private System.Windows.Forms.ColumnHeader columnHeader5;
    private System.Windows.Forms.OpenFileDialog openFileDialog1;
    private System.Windows.Forms.ToolStripButton toolStripButton3;
    private System.Windows.Forms.ToolStripButton toolStripButton4;
    private System.Windows.Forms.ColumnHeader columnHeader6;
    private System.Windows.Forms.ImageList imageList1;
    private System.Windows.Forms.ToolStripStatusLabel tsslFileNum;
    private System.Windows.Forms.ToolStripButton toolStripButton5;
    private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
    private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
    private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
    private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
    private System.Windows.Forms.ToolStripStatusLabel tsslPlan;
    private System.Windows.Forms.ColumnHeader columnHeader7;
}

以上就是利用C#实现批量图片格式转换功能的详细内容,更多关于C#图片格式转换的资料请关注我们其它相关文章!

如有侵权,请发邮件到 [email protected]

相关文章

  • vs2019安装和使用详细图文教程

    vs2019安装和使用详细图文教程

    vs2019已经在4月2日正式发布,vs2019发布会请看这个链接: vs2019发布活动 vs2019和vs2017一样强大,项目兼容,不用互相删除,而且C/C++,Python,F#,ios,Android,Web,Node.js,Azure,Unity,HTML,
    2020-03-10
  • VS2019使用快捷键将代码对齐的方法

    VS2019使用快捷键将代码对齐的方法

    1、选中需要对齐的行 2、CTRL+K 3、CTRL+F 对齐前: 对齐后: 补充:VS中代码对齐等快捷键 在VS2008中,选定代码后,按Ctrl+K+F组合键,可以自动进行代码对齐。 注意:要先按下Ctrl和K,再按
    2020-04-01
  • c# 类成员初始化顺序的特殊情况

    c# 类成员初始化顺序的特殊情况

    这里直接给出C#类成员一般初始化顺序: 子类静态字段 子类静态构造 子类实例字段 父类静态字段 父类静态构造 父类实例字段 父类实例构造 子类实例构造 为什么说是“一般”初始化
    2020-06-30
  • 使用Visual Studio2019创建C#项目(窗体应用程序、控制台应用程序、

    使用Visual Studio2019创建C#项目(窗体应用程序、控制台应用程序、

    一、VS的开发环境 首先你得安装了vs2019,然后确认下下面三个组件是否存在,如果没有要下载一下。vs2019的安装可参考visual studio2019的安装以及使用。 二、创建C#窗体应用程序 打开vs 可
    2020-03-08
  • C# XML字符串包含特殊字符的处理转换方法小结

    C# XML字符串包含特殊字符的处理转换方法小结

    为了能正常输出XML格式的内容,必须要对不被XML允许的那些特殊字符进行转换。本文介绍的正是如何使用C#判断XML字符串是否含特殊字符并进行转换。 以下是几个特殊字符的对应实体。
    2020-07-01
  • Unity实现俄罗斯方块游戏

    Unity实现俄罗斯方块游戏

    本文实例为大家分享了Unity实现俄罗斯方块游戏的具体代码,供大家参考,具体内容如下 一、演示 二、实现思路 创建每一个方块可移动到的位置点,可以理解为创建一个游戏地图,从
    2020-06-21
  • c# Newtonsoft 六个值得使用的特性(上)

    c# Newtonsoft 六个值得使用的特性(上)

    一:讲故事 看完官方文档,阅读了一些 Newtonsoft 源码,对它有了新的认识,先总结 六个超经典又实用的特性,同大家一起分享,废话不多说,快来一起看看吧~~~ 二:特性分析 1. 代码格
    2020-06-23
  • c#压缩字符串的方法

    c#压缩字符串的方法

    一:背景 1. 讲故事 在我们的一个全内存项目中,需要将一家大品牌店铺小千万的trade灌入到内存中,大家知道trade中一般会有订单来源,省市区 ,当把这些字段灌进去后,你会发现他们
    2020-06-24