在C#中的列表框中添加和删除pic格式 [英] Add and remove pic format inside a listbox in C#

查看:117
本文介绍了在C#中的列表框中添加和删除pic格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我想在C#中制作(图像渲染工具)。从(来源)中选择图片并保存到(目标)并按下添加按钮我想看到里面的图片格式(格式)listBox所以我可以选择一个例如JPG或PNG并按(删除)按钮清除我选择的图片格式从listBox和Reoloution我想要垂直和水平更改图片,并按执行图片或图片大小更改,并保存(目标)。抱歉我的英语不好。

i想要加载我的表格的截图但不知道如何添加到这里



我尝试了什么:



这个按钮来源:

Hello,

i am trying to make (Image-rendering tool)in C#. Select pic from (Source) and save to (Goal) and by pressing Add button i want to see pic formates inside (Format) listBox so i can select one for example JPG or PNG and by pressing (Delete) button clear my selected pics format from listBox and by Reoloution i want to change pics vertically and horizontally and by pressing execute pics or pic size change and also save in (Goal). sorry for my bad English.
i want to uppload a screenshot of my Form but can't don't know how to add here

What I have tried:

this for button Source:

{
            FolderBrowserDialog fbd = new FolderBrowserDialog();
            fbd.Description = "Wählen Sie eine Quellordner aus...";
            fbd.RootFolder = Environment.SpecialFolder.DesktopDirectory;

            if(fbd.ShowDialog() == DialogResult.OK)
            {
                textBox1.Text = fbd.SelectedPath;
            }

This for button Goal:

 {
            FolderBrowserDialog fbd = new FolderBrowserDialog();
            fbd.Description = "Ausgewählte Ordner...";
            fbd.RootFolder = Environment.SpecialFolder.DesktopDirectory;

            if (fbd.ShowDialog() == DialogResult.OK)
            {
                textBox2.Text = fbd.SelectedPath;
            }

Settings.cs

namespace Bild_Aufbereitungs_Tools
{
    public class Settings
    {
        public string VerzeichnisQuelle { get; set; }
        public string VerzeichnisZiel { get; set; }
        List<string> FormatList { get; set; }

        public Settings()
        {

        }
    }
}

Program.cs

  {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {

            App.Einstellungen = new Settings();
            App.BildAufbereitung = new PicCompression();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}

PicComperssion.cs

namespace Bild_Aufbereitungs_Tools
{
    public class PicCompression
    {
    }
}

App.cs

namespace Bild_Aufbereitungs_Tools
{
    public static class App
    {
        public static string Title = "Title";
        public static Settings Einstellungen;
        public static PicCompression BildAufbereitung;

    }
}

推荐答案

阅读完所有讨论后,我认为你是从Image看的裁剪工具

网上有很多工作示例,这里有一个

如何在C#中制作图像编辑器工具:裁剪图像 [ ^ ]



根据你的imageformat选择使用方法,
After reading all discussion, I think you are looking from Image cropping tool
there many working examples available online, here is one
How to make image editor tool in C# : Cropping image[^]

And as per your imageformat selection use method ,
Bitmap.Save


这篇关于在C#中的列表框中添加和删除pic格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆