png透明背景转换

2 篇文章 0 订阅
1 篇文章 0 订阅

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SchemaStampImageTransformation
{
public partial class Form1 : Form
{
[DllImport(“user32.dll”)]
private static extern IntPtr GetDC(IntPtr hwnd);

    [DllImport("gdi32.dll")]
    private static extern int GetPixel(IntPtr hdc, Point p);

    public string savePath = string.Empty;
    public string imagePath = string.Empty;

    public FileInfo[] Images;

    public Form1()
    {
        InitializeComponent();
        this.listView1.View = View.LargeIcon;

    }

    private void button1_Click(object sender, EventArgs e)
    {
        imagePath = this.imgPath.Text;

        if (string.IsNullOrEmpty(imagePath.Trim()))
        {
            this.folderBrowserDialog1.ShowDialog();
            if (this.folderBrowserDialog1.SelectedPath == "")
            {
                MessageBox.Show("选择一个路径!");
                return;
            }
            else

j {
imagePath = this.folderBrowserDialog1.SelectedPath;
}
}

        imagePath += "\\";

        SetListViewItemsRead(listView1, this.imageList1, GetGroupBoxValue(this.groupBox2), imagePath);
    }

    private void button2_Click(object sender, EventArgs e)
    {
        List<string> resultImageNameList = new List<string>();

        this.listView2.Items.Clear();

        savePath = this.saveImageiPath.Text.Trim();
        if (string.IsNullOrWhiteSpace(savePath))
        {
            this.folderBrowserDialog1.ShowDialog();
            if (this.folderBrowserDialog1.SelectedPath == "")
            {
                MessageBox.Show("请选择画像的保存路径!");
                return;
            }
            else
            {
                this.saveImagePath.Text = this.folderBrowserDialog1.SelectedPath;
            }
        }
        elsen if (System.IO.Directory.Exists(savePath))
        {
            this.folderBrowserDialog1.SelectedPath = this.imgPath.Text;
        }
        else
        {
            MessageBox.Show("目标路径不存在,请确认!");
            return;
        }

        savePath = this.saveImagePath.Text.Trim();
        savePath += "\\";

        int selectedItemsCount = this.listView1.SelectedItems.Count;
        if (selectedItemsCount == 0)
        {
         h i MessageBox.Show("请选择要变换的画像!");
            return;
        }
        else
        {
            Bitmap bmp;
            string switchFileName = string.Empty;
            string existsFileName = string.Empty;

            for (int i = 0; i < selectedItemsCount; i++)
            {
                bmp = new Bitmap(this.listView1.SelectedItems[i].Tag.ToString());
                if (bmp != null)
                {
                    switchFilwjame = this.listView1.SelectedItems[i].Text.Replace(".BMP", ".png").Replace(".bmp", ".png").Replace(".jpg", ".png").Replace(".jpeg", ".png").Replace(".PNG", ".png").Replace(".png.png", ".png").Replace(".JPG", ".png");
                    existsFileName += savePath + switchFileName;
                    if (System.IO.File.Exists(existsFileName))
                    {
                        if (MessageBox.Show("目标文件【" + switchFileName + "】已经存在、\n请确认是否覆盖源文件!", "文件Check",
                            MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.OK)
                        {
                            try
                            {
                                System.IO.File.Delete(existsFileName);
                            }
                            catch (IOException)
                            {
                                MessageBox.Show("别的进程正在使用文件、\n对象文件【 " + existsFileName + "】不能访问 。");
                                return;
                            }
                        }
                        else
                        {
                            return;
                        }
                    }

                    resultImageNameList.Add(switchFileName);
                    SaveBmpAsPNG(bmp, savePath, this.listView1.SelectedItems[i].Text.Replace(".BMP", "")
                        .Replace(".bmp", "").Replace(".jpg", "").Replace(".JPG", "").Replace(".jpeg", "").Replace(".png", "").Replace(".PNG", ""));
                }
            }
        }

        SetListViewItems(listView2, this.imageList2, this.label5.Text, savePath, resultImageNameList);
        MessageBox.Show("画像转换成功!");

    }

    /// <summary>
    /// 指定的颜色背静透明并保存为png
    /// </summary>
    /// <param name="bmp"></param>
    /// <param name="savePath"></param>
    /// <param name="fileName"></param>
    private void SaveBmpAsPNG(Bitmap bmp, string savePath,string fileName)
    {

        string savePngPath = savePath + fileName + ".png";
        savePngPath.Replace(".bmp", "").Replace(".BMP","");

        // 获取指定的颜色
        Color seltctedColor = this.label3.BackColor;

        // 指定的颜色背静透明
        if (seltctedColor != System.Drawing.SystemColors.ActiveCaption)
        {
            bmp.MakeTransparent(Color.FromArgb(0, seltctedColor));
            bmp.MakeTransparent(Color.FromArgb(0, Color.White));
        }
      
        bmp.Save(savePngPath, ImageFormat.Png);
        bmp.Dispose();
    }

    private void LargeIcon_CheckedChanged(object sender, EventArgs e)
    {
        this.listView1.View = View.LargeIcon;
    }

    private void SmallIcon_CheckedChanged(object sender, EventArgs e)
    {
        this.listView1.View = View.SmallIcon;
    }

    private void IconList_CheckedChanged(object sender, EventArgs e)
    {
        this.listView1.View = View.List;
    }

    private void Details_CheckedChanged(object sender, EventArgs e)
    {
        this.listView1.View = View.Details;
    }

    private void button3_Click(object sender, EventArgs e)
    {

    }

    private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
    {
        Bitmap btp = pictureBox1.Image as Bitmap;
        try
        {
            string displayInfo = string.Empty;
            Point p = new Point(MousePosition.X, MousePosition.Y);
              IntPtr hdc = GetDC(new IntPtr(0));
              string txtStartX = MousePosition.X.ToString();
              string txtStartY = MousePosition.Y.ToString();
              int c = GetPixel(hdc, p);
              int r = (c & 0xFF);
              int g = (c & 0xFF00) / 256;
              int b = (c & 0xFF0000) / 65536;
              displayInfo = "背景色RGB:  R:" + r.ToString() + ",  G:" + g.ToString() + ",  B:" + b.ToString() + "\n";
              displayInfo += "坐标位置 :  X:" + txtStartX + "px,  Y:" + txtStartY + "px";
              label6.Text = displayInfo;

              label3.BackColor = Color.FromArgb(r, g, b);
        }
        catch (Exception)
        {
            MessageBox.Show("请在图像内选择!");
        }
    }

    private void listView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        int selectedItemsCount = this.listView1.SelectedItems.Count;
        if (selectedItemsCount == 0)
        {
            return;
        }
        else
        {
            this.pictureBox1.BackgroundImage = System.Drawing.Image.FromFile(this.listView1.SelectedItems[selectedItemsCount - 1].Tag.ToString());
        }
    }


    private void SetListViewItemsRead(ListView listView, ImageList imageList, string getImageType, string imagePath)
    {
        DirectoryInfo Folder;

        if (string.IsNullOrWhiteSpace(imagePath))
        {
            MessageBox.Show("请选择正确的画像路径!");
        }

        listView.View = View.LargeIcon;

        try
        {
            Folder = new DirectoryInfo(imagePath);
            Images = Folder.GetFiles(getImageType);
        }
        catch (DirectoryNotFoundException)
        {
            MessageBox.Show("目标路径不存在,请确认!");
            return;
        }
        if (Images != null && Images.Length > 0)
        {
            imageList.Images.Clear();
            listView.Items.Clear();

            try
            {
                foreach (var item in Images)
                {
                    imageList.Images.Add(System.Drawing.Image.FromFile(imagePath + item.Name));
                }
            }
            catch (FileNotFoundException)
            {
                MessageBox.Show("文件不存!");
            }
            listView.SmallImageList = imageList;
            listView.LargeImageList = imageList;

            for (int i = 0; i < Images.Length; i++)
            {
                ListViewItem listViewItem = new ListViewItem();

                listViewItem.ImageIndex = i;
                listViewItem.Text = Images[i].Name;
                listViewItem.Tag = imagePath + Images[i].Name;
                listView.Items.Add(listViewItem);
            }
        }
        else
        {
            MessageBox.Show("没有满足条件的画像!");
        }
    }

    private void SetListViewItems(ListView listView, ImageList imageList, string getImageType, string imagePath, 
        List<string> resultImageNameList)
    {
        DirectoryInfo Folder;

        if (string.IsNullOrWhiteSpace(imagePath))
        {
            MessageBox.Show("请选择正确的画像!");
        }

        try
        {
            Folder = new DirectoryInfo(imagePath);
            Images = Folder.GetFiles(getImageType);
        }
        catch (DirectoryNotFoundException)
        {
            MessageBox.Show("目标路径不存在,请确认!!");
            return;
        }

        if (Images != null && Images.Length > 0)
        {
            imageList.Images.Clear();
            listView.Items.Clear();

            listView.View = View.LargeIcon;

            foreach (var item in resultImageNameList)
            {
                imageList.Images.Add(System.Drawing.Image.FromFile(imagePath + item));
            }

            listView.SmallImageList = imageList;
            listView.LargeImageList = imageList;

            for (int i = 0; i < resultImageNameList.Count; i++)
            {
                ListViewItem listViewItem = new ListViewItem();

                listViewItem.ImageIndex = i;
                listViewItem.Text = resultImageNameList[i];
                listViewItem.Tag = imagePath + resultImageNameList[i];
                listView.Items.Add(listViewItem);
            }
        }
        else
        {
            MessageBox.Show("没问满足条件的文件!");
        }
    }

    /// <summary>
    ///
    /// </summary>
    /// <param name="groupBox"></param>
    /// <returns></returns>
    private string GetGroupBoxValue(GroupBox groupBox)
    {
        string result = string.Empty;

        if (groupBox != null)
        {
            for (int i = 0; i < groupBox.Controls.Count; i++)
            {
                RadioButton temp = groupBox.Controls[i] as RadioButton;
                if (temp != null && temp.Checked)
                {
                    result = temp.Text;
                }
            }
        }

        return result;
    }

    private void button3_Click_1(object sender, EventArgs e)
    {
        System.Diagnostics.Process.Start(this.saveImagePath.Text); 
    }

    private void pictureBox2_Click(object sender, EventArgs e)
    {

    }

    private void button4_Click_1(object sender, EventArgs e)
    {
        if (System.IO.Directory.Exists(this.imgPath.Text))
        {
            this.folderBrowserDialog1.SelectedPath = this.imgPath.Text;
        }
        this.folderBrowserDialog1.ShowDialog();
        if (this.folderBrowserDialog1.SelectedPath == "")
        {
            return;
        }
        else
        {
            this.imgPath.Text = this.folderBrowserDialog1.SelectedPath;
        }
    }

    private void button5_Click(object sender, EventArgs e)
    {
        if (System.IO.Directory.Exists(this.saveImagePath.Text))
        {
            this.folderBrowserDialog1.SelectedPath = this.saveImagePath.Text;
        }
        this.folderBrowserDialog1.ShowDialog();
        if (this.folderBrowserDialog1.SelectedPath == "")
        {
            return;
        }
        else
        {
            this.saveImagePath.Text = this.folderBrowserDialog1.SelectedPath;
        }
    }

    private void listView2_SelectedIndexChanged(object sender, EventArgs e)
    {
        int selectedItemsCount = this.listView2.SelectedItems.Count;
        if (selectedItemsCount == 0)
        {
            return;
        }
        else
        {
            this.pictureBox3.BackgroundImage = System.Drawing.Image.FromFile(this.listView2.SelectedItems[selectedItemsCount - 1].Tag.ToString());
        }
    }


          
}

}

using System.Windows.Forms;
namespace SchemaStampImageTransformation
{
partial class Form1
{
private System.ComponentModel.IContainer components = null;

  protected override void Dispose(bool disposing)
    {
        if (disposing && (components != null))
        {
            components.Dispose();
        }
        base.Dispose(disposing);
    }

private void InitializeComponent()
    {
        this.components = new System.ComponentModel.Container();
        System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
        this.Image = new System.Windows.Forms.Label();
        this.label2 = new System.Windows.Forms.Label();
        this.imgPath = new System.Windows.Forms.TextBox();
        this.saveImagePath = new System.Windows.Forms.TextBox();
        this.button1 = new System.Windows.Forms.Button();
        this.button2 = new System.Windows.Forms.Button();
        this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
        this.listView1 = new System.Windows.Forms.ListView();
        this.imageList1 = new System.Windows.Forms.ImageList(this.components);
        this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
        this.listView2 = new System.Windows.Forms.ListView();
        this.LargeIcon = new System.Windows.Forms.RadioButton();
        this.SmallIcon = new System.Windows.Forms.RadioButton();
        this.IconList = new System.Windows.Forms.RadioButton();
        this.radioButton1 = new System.Windows.Forms.RadioButton();
        this.radioButton2 = new System.Windows.Forms.RadioButton();
        this.radioButton3 = new System.Windows.Forms.RadioButton();
        this.label1 = new System.Windows.Forms.Label();
        this.label3 = new System.Windows.Forms.Label();
        this.imageList2 = new System.Windows.Forms.ImageList(this.components);
        this.label4 = new System.Windows.Forms.Label();
        this.groupBox1 = new System.Windows.Forms.GroupBox();
        this.groupBox2 = new System.Windows.Forms.GroupBox();
        this.groupBox3 = new System.Windows.Forms.GroupBox();
        this.label5 = new System.Windows.Forms.Label();
        this.button3 = new System.Windows.Forms.Button();
        this.button4 = new System.Windows.Forms.Button();
        this.pictureBox2 = new System.Windows.Forms.PictureBox();
        this.pictureBox1 = new System.Windows.Forms.PictureBox();
        this.button5 = new System.Windows.Forms.Button();
        this.label6 = new System.Windows.Forms.Label();
        this.label7 = new System.Windows.Forms.Label();
        this.pictureBox3 = new System.Windows.Forms.PictureBox();
        this.label8 = new System.Windows.Forms.Label();
        this.groupBox1.SuspendLayout();
        this.groupBox2.SuspendLayout();
        this.groupBox3.SuspendLayout();
        ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
        this.SuspendLayout();
        // 
        // Image
        // 
        this.Image.AutoSize = true;
        this.Image.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
        this.Image.Location = new System.Drawing.Point(22, 25);
        this.Image.Name = "Image";
        this.Image.Size = new System.Drawing.Size(83, 12);
        this.Image.TabIndex = 0;
        this.Image.Text = "画像读取路径:";
        // 
        // label2
        // 
        this.label2.AutoSize = true;
        this.label2.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
        this.label2.Location = new System.Drawing.Point(22, 54);
        this.label2.Name = "label2";
        this.label2.Size = new System.Drawing.Size(81, 12);
        this.label2.TabIndex = 1;
        this.label2.Text = "画像保存路径:";
        // 
        // imgPath
        // 
        this.imgPath.AllowDrop = true;
        this.imgPath.Location = new System.Drawing.Point(121, 23);
        this.imgPath.Name = "imgPath";
        this.imgPath.Size = new System.Drawing.Size(367, 19);
        this.imgPath.TabIndex = 2;
        this.imgPath.Text = "C:\\Schema_Test\\【GX】STAMP";
        // 
        // saveImagePath
        // 
        this.saveImagePath.AllowDrop = true;
        this.saveImagePath.Location = new System.Drawing.Point(121, 51);
        this.saveImagePath.Name = "saveImagePath";
        this.saveImagePath.Size = new System.Drawing.Size(367, 19);
        this.saveImagePath.TabIndex = 3;
        this.saveImagePath.Text = "C:\\Schema_Test\\【GX】STAMP_PNG";
        // 
        // button1
        // 
        this.button1.Location = new System.Drawing.Point(533, 17);
        this.button1.Name = "button1";
        this.button1.Size = new System.Drawing.Size(75, 25);
        this.button1.TabIndex = 5;
        this.button1.Text = "读取";
        this.button1.UseVisualStyleBackColor = true;
        this.button1.Click += new System.EventHandler(this.button1_Click);
        // 
        // button2
        // 
        this.button2.Location = new System.Drawing.Point(533, 48);
        this.button2.Name = "button2";
        this.button2.Size = new System.Drawing.Size(75, 25);
        this.button2.TabIndex = 6;
        this.button2.Text = "转换";
        this.button2.UseVisualStyleBackColor = true;
        this.button2.Click += new System.EventHandler(this.button2_Click);
        // 
        // openFileDialog1
        // 
        this.openFileDialog1.FileName = "openFileDialog1";
        // 
        // listView1
        // 
        this.listView1.Location = new System.Drawing.Point(24, 155);
        this.listView1.Name = "listView1";
        this.listView1.Size = new System.Drawing.Size(335, 339);
        this.listView1.TabIndex = 7;
        this.listView1.UseCompatibleStateImageBehavior = false;
        this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
        // 
        // imageList1
        // 
        this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
        this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
        this.imageList1.Images.SetKeyName(0, "TOOL.JPG");
        // 
        // listView2
        // 
        this.listView2.Location = new System.Drawing.Point(445, 155);
        this.listView2.MultiSelect = false;
        this.listView2.Name = "listView2";
        this.listView2.Size = new System.Drawing.Size(339, 339);
        this.listView2.TabIndex = 8;
        this.listView2.UseCompatibleStateImageBehavior = false;
        this.listView2.SelectedIndexChanged += new System.EventHandler(this.listView2_SelectedIndexChanged);
        // 
        // LargeIcon
        // 
        this.LargeIcon.AutoSize = true;
        this.LargeIcon.Checked = true;
        this.LargeIcon.Location = new System.Drawing.Point(5, 18);
        this.LargeIcon.Name = "LargeIcon";
        this.LargeIcon.Size = new System.Drawing.Size(81, 16);
        this.LargeIcon.TabIndex = 9;
        this.LargeIcon.TabStop = true;
        this.LargeIcon.Text = "LargeIcon";
        this.LargeIcon.UseVisualStyleBackColor = true;
        this.LargeIcon.CheckedChanged += new System.EventHandler(this.LargeIcon_CheckedChanged);
        // 
        // SmallIcon
        // 
        this.SmallIcon.AutoSize = true;
        this.SmallIcon.Location = new System.Drawing.Point(93, 18);
        this.SmallIcon.Name = "SmallIcon";
        this.SmallIcon.Size = new System.Drawing.Size(81, 16);
        this.SmallIcon.TabIndex = 10;
        this.SmallIcon.TabStop = true;
        this.SmallIcon.Text = "SmallIcon";
        this.SmallIcon.UseVisualStyleBackColor = true;
        this.SmallIcon.CheckedChanged += new System.EventHandler(this.SmallIcon_CheckedChanged);
        // 
        // IconList
        // 
        this.IconList.AutoSize = true;
        this.IconList.Location = new System.Drawing.Point(183, 18);
        this.IconList.Name = "IconList";
        this.IconList.Size = new System.Drawing.Size(71, 16);
        this.IconList.TabIndex = 11;
        this.IconList.TabStop = true;
        this.IconList.Text = "IconList";
        this.IconList.UseVisualStyleBackColor = true;
        this.IconList.CheckedChanged += new System.EventHandler(this.IconList_CheckedChanged);
        // 
        // radioButton1
        // 
        this.radioButton1.AutoSize = true;
        this.radioButton1.Checked = true;
        this.radioButton1.Location = new System.Drawing.Point(10, 18);
        this.radioButton1.Name = "radioButton1";
        this.radioButton1.Size = new System.Drawing.Size(57, 16);
        this.radioButton1.TabIndex = 12;
        this.radioButton1.TabStop = true;
        this.radioButton1.Text = "*.bmp";
        this.radioButton1.UseVisualStyleBackColor = true;
        // 
        // radioButton2
        // 
        this.radioButton2.AutoSize = true;
        this.radioButton2.Location = new System.Drawing.Point(73, 18);
        this.radioButton2.Name = "radioButton2";
        this.radioButton2.Size = new System.Drawing.Size(54, 16);
        this.radioButton2.TabIndex = 13;
        this.radioButton2.TabStop = true;
        this.radioButton2.Text = "*.png";
        this.radioButton2.UseVisualStyleBackColor = true;
        // 
        // radioButton3
        // 
        this.radioButton3.AutoSize = true;
        this.radioButton3.Enabled = false;
        this.radioButton3.Location = new System.Drawing.Point(137, 18);
        this.radioButton3.Name = "radioButton3";
        this.radioButton3.Size = new System.Drawing.Size(51, 16);
        this.radioButton3.TabIndex = 14;
        this.radioButton3.TabStop = true;
        this.radioButton3.Text = "*.jpg";
        this.radioButton3.UseVisualStyleBackColor = true;
        // 
        // label1
        // 
        this.label1.AutoSize = true;
        this.label1.ForeColor = System.Drawing.Color.Crimson;
        this.label1.Location = new System.Drawing.Point(247, 540);
        this.label1.Name = "label1";
        this.label1.Size = new System.Drawing.Size(67, 12);
        this.label1.TabIndex = 17;
        this.label1.Text = "指定需要变更的背景色:";
        // 
        // label3
        // 
        this.label3.AutoSize = true;
        this.label3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
        this.label3.Location = new System.Drawing.Point(264, 561);
        this.label3.MinimumSize = new System.Drawing.Size(50, 30);
        this.label3.Name = "label3";
        this.label3.Size = new System.Drawing.Size(50, 30);
        this.label3.TabIndex = 18;
        // 
        // imageList2
        // 
        this.imageList2.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
        this.imageList2.ImageSize = new System.Drawing.Size(16, 16);
        this.imageList2.TransparentColor = System.Drawing.Color.Transparent;
        // 
        // label4
        // 
        this.label4.AutoSize = true;
        this.label4.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
        this.label4.ForeColor = System.Drawing.SystemColors.HotTrack;
        this.label4.Location = new System.Drawing.Point(24, 509);
        this.label4.Name = "label4";
        this.label4.Size = new System.Drawing.Size(176, 12);
        this.label4.TabIndex = 19;
        this.label4.Text = "请选择需要变更的背景色。";
        // 
        // groupBox1
        // 
        this.groupBox1.Controls.Add(this.SmallIcon);
        this.groupBox1.Controls.Add(this.LargeIcon);
        this.groupBox1.Controls.Add(this.IconList);
        this.groupBox1.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
        this.groupBox1.ForeColor = System.Drawing.Color.DarkCyan;
        this.groupBox1.Location = new System.Drawing.Point(24, 91);
        this.groupBox1.Name = "groupBox1";
        this.groupBox1.Size = new System.Drawing.Size(258, 45);
        this.groupBox1.TabIndex = 20;
        this.groupBox1.TabStop = false;
        this.groupBox1.Text = "读取画像的表示方法";
        // 
        // groupBox2
        // 
        this.groupBox2.Controls.Add(this.radioButton2);
        this.groupBox2.Controls.Add(this.radioButton1);
        this.groupBox2.Controls.Add(this.radioButton3);
        this.groupBox2.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
        this.groupBox2.ForeColor = System.Drawing.Color.DarkCyan;
        this.groupBox2.Location = new System.Drawing.Point(300, 91);
        this.groupBox2.Name = "groupBox2";
        this.groupBox2.Size = new System.Drawing.Size(200, 45);
        this.groupBox2.TabIndex = 21;
        this.groupBox2.TabStop = false;
        this.groupBox2.Text = "读取画像的类型";
        // 
        // groupBox3
        // 
        this.groupBox3.Controls.Add(this.label5);
        this.groupBox3.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
        this.groupBox3.ForeColor = System.Drawing.Color.DarkCyan;
        this.groupBox3.Location = new System.Drawing.Point(519, 91);
        this.groupBox3.Name = "groupBox3";
        this.groupBox3.Size = new System.Drawing.Size(144, 45);
        this.groupBox3.TabIndex = 23;
        this.groupBox3.TabStop = false;
        this.groupBox3.Text = "转换后的文件类型:";
        // 
        // label5
        // 
        this.label5.AutoSize = true;
        this.label5.Font = new System.Drawing.Font("MS UI Gothic", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
        this.label5.ForeColor = System.Drawing.Color.Crimson;
        this.label5.Location = new System.Drawing.Point(40, 17);
        this.label5.Name = "label5";
        this.label5.Size = new System.Drawing.Size(45, 15);
        this.label5.TabIndex = 0;
        this.label5.Text = "*.png";
        // 
        // button3
        // 
        this.button3.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
        this.button3.ForeColor = System.Drawing.Color.DarkCyan;
        this.button3.Location = new System.Drawing.Point(684, 122);
        this.button3.Margin = new System.Windows.Forms.Padding(0);
        this.button3.MinimumSize = new System.Drawing.Size(100, 30);
        this.button3.Name = "button3";
        this.button3.Size = new System.Drawing.Size(100, 30);
        this.button3.TabIndex = 24;
        this.button3.Text = "打开文件夹";
        this.button3.UseVisualStyleBackColor = true;
        this.button3.Click += new System.EventHandler(this.button3_Click_1);
        // 
        // button4
        // 
        this.button4.BackgroundImage = global::SchemaStampImageTransformation.Properties.Resources.Deploy__root_folder_16px;
        this.button4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
        this.button4.Location = new System.Drawing.Point(494, 19);
        this.button4.Name = "button4";
        this.button4.Size = new System.Drawing.Size(26, 24);
        this.button4.TabIndex = 25;
        this.button4.UseVisualStyleBackColor = true;
        this.button4.Click += new System.EventHandler(this.button4_Click_1);
        // 
        // pictureBox2
        // 
        this.pictureBox2.BackgroundImage = global::SchemaStampImageTransformation.Properties.Resources.Right;
        this.pictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
        this.pictureBox2.Location = new System.Drawing.Point(365, 294);
        this.pictureBox2.Margin = new System.Windows.Forms.Padding(0);
        this.pictureBox2.Name = "pictureBox2";
        this.pictureBox2.Size = new System.Drawing.Size(74, 38);
        this.pictureBox2.TabIndex = 22;
        this.pictureBox2.TabStop = false;
        this.pictureBox2.Click += new System.EventHandler(this.button2_Click);
        // 
        // pictureBox1
        // 
        this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
        this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
        this.pictureBox1.Location = new System.Drawing.Point(24, 524);
        this.pictureBox1.MinimumSize = new System.Drawing.Size(200, 120);
        this.pictureBox1.Name = "pictureBox1";
        this.pictureBox1.Size = new System.Drawing.Size(200, 120);
        this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
        this.pictureBox1.TabIndex = 15;
        this.pictureBox1.TabStop = false;
        this.pictureBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseDown);
        // 
        // button5
        // 
        this.button5.BackgroundImage = global::SchemaStampImageTransformation.Properties.Resources.Deploy__root_folder_16px;
        this.button5.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
        this.button5.Location = new System.Drawing.Point(494, 47);
        this.button5.Name = "button5";
        this.button5.Size = new System.Drawing.Size(26, 26);
        this.button5.TabIndex = 26;
        this.button5.UseVisualStyleBackColor = true;
        this.button5.Click += new System.EventHandler(this.button5_Click);
        // 
        // label6
        // 
        this.label6.AutoSize = true;
        this.label6.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
        this.label6.Location = new System.Drawing.Point(244, 614);
        this.label6.MinimumSize = new System.Drawing.Size(150, 30);
        this.label6.Name = "label6";
        this.label6.Size = new System.Drawing.Size(150, 30);
        this.label6.TabIndex = 27;
        // 
        // label7
        // 
        this.label7.AutoSize = true;
        this.label7.Font = new System.Drawing.Font("MS UI Gothic", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
        this.label7.ForeColor = System.Drawing.Color.Crimson;
        this.label7.Location = new System.Drawing.Point(22, 139);
        this.label7.Name = "label7";
        this.label7.Size = new System.Drawing.Size(278, 12);
        this.label7.TabIndex = 28;
        this.label7.Text = "※请选择200*120左右的画像。";
        // 
        // pictureBox3
        // 
        this.pictureBox3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
        this.pictureBox3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
        this.pictureBox3.Location = new System.Drawing.Point(568, 509);
        this.pictureBox3.Name = "pictureBox3";
        this.pictureBox3.Size = new System.Drawing.Size(216, 135);
        this.pictureBox3.TabIndex = 29;
        this.pictureBox3.TabStop = false;
        // 
        // label8
        // 
        this.label8.AutoSize = true;
        this.label8.ForeColor = System.Drawing.SystemColors.HotTrack;
        this.label8.Location = new System.Drawing.Point(443, 509);
        this.label8.Name = "label8";
        this.label8.Size = new System.Drawing.Size(119, 12);
        this.label8.TabIndex = 30;
        this.label8.Text = "变换后的画像预览";
        // 
        // Form1
        // 
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.ClientSize = new System.Drawing.Size(843, 663);
        this.Controls.Add(this.label8);
        this.Controls.Add(this.pictureBox3);
        this.Controls.Add(this.label7);
        this.Controls.Add(this.label6);
        this.Controls.Add(this.button5);
        this.Controls.Add(this.button4);
        this.Controls.Add(this.button3);
        this.Controls.Add(this.groupBox3);
        this.Controls.Add(this.pictureBox2);
        this.Controls.Add(this.groupBox2);
        this.Controls.Add(this.groupBox1);
        this.Controls.Add(this.label4);
        this.Controls.Add(this.label3);
        this.Controls.Add(this.label1);
        this.Controls.Add(this.pictureBox1);
        this.Controls.Add(this.listView2);
        this.Controls.Add(this.listView1);
        this.Controls.Add(this.button2);
        this.Controls.Add(this.button1);
        this.Controls.Add(this.saveImagePath);
        this.Controls.Add(this.imgPath);
        this.Controls.Add(this.label2);
        this.Controls.Add(this.Image);
        this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
        this.MaximizeBox = false;
        this.MinimizeBox = false;
        this.Name = "Form1";
        this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
        this.Text = "画像透明背景转换工具_v 1.1.01测试版";
        this.groupBox1.ResumeLayout(false);
        this.groupBox1.PerformLayout();
        this.groupBox2.ResumeLayout(false);
        this.groupBox2.PerformLayout();
        this.groupBox3.ResumeLayout(false);
        this.groupBox3.PerformLayout();
        ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
        this.ResumeLayout(false);
        this.PerformLayout();

    }

    #endregion

    private System.Windows.Forms.Label Image;
    private System.Windows.Forms.Label label2;
    private System.Windows.Forms.TextBox imgPath;
    private System.Windows.Forms.TextBox saveImagePath;
    private System.Windows.Forms.Button button1;
    private System.Windows.Forms.Button button2;
    private System.Windows.Forms.OpenFileDialog openFileDialog1;
    private System.Windows.Forms.ListView listView1;
    private System.Windows.Forms.ImageList imageList1;
    private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
    private System.Windows.Forms.ListView listView2;
    private System.Windows.Forms.RadioButton LargeIcon;
    private System.Windows.Forms.RadioButton SmallIcon;
    private System.Windows.Forms.RadioButton IconList;
    private System.Windows.Forms.RadioButton radioButton1;
    private System.Windows.Forms.RadioButton radioButton2;
    private System.Windows.Forms.RadioButton radioButton3;
    private System.Windows.Forms.PictureBox pictureBox1;
    private System.Windows.Forms.Label label1;
    private System.Windows.Forms.Label label3;
    private System.Windows.Forms.ImageList imageList2;
    private System.Windows.Forms.Label label4;
    private System.Windows.Forms.GroupBox groupBox1;
    private System.Windows.Forms.GroupBox groupBox2;
    private System.Windows.Forms.PictureBox pictureBox2;
    private System.Windows.Forms.GroupBox groupBox3;
    private System.Windows.Forms.Label label5;
    private System.Windows.Forms.Button button3;
    private Button button4;
    private Button button5;
    private Label label6;
    private Label label7;
    private PictureBox pictureBox3;
    private Label label8;
}

}
在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
>