예제 #1
0
 static void Main(string[] args)
 {
     Console.WriteLine("Image Editor is starting");
     if (args.Length == 0)
     {
         Console.WriteLine("Please enter a image path");
         string path = Console.ReadLine();
         ImgEditor.EditImage(path);
     }
     else
     {
         string imageLink = args[0];
         Console.WriteLine("Argument is passed: " + imageLink);
         ImgEditor.EditImage(imageLink);
     }
 }
예제 #2
0
 private void RefrechBarGraph()
 {
     if (bitmapImg != null)
     {
         Bitmap newImg;
         newImg = ImgEditor.CalculateBarChar(new Bitmap((Bitmap)pictureBoxEdit.Image));
         newImg = ImgEditor.ResizeImg(ref newImg, 256);
         //myChart.Image = newImg;
         pictureBoxEdit.Refresh();
         pictureBoxStock.Refresh();
     }
     else
     {
         MessageBox.Show("Изображение не загружено.");
     }
 }
예제 #3
0
 private void contransButton_Click(object sender, EventArgs e)
 {
     if (bitmapImg != null)
     {
         Bitmap newImg;
         Task.Run(() =>
         {
             newImg = ImgEditor.SetsContrans(new Bitmap(bitmapImg));
             pictureBoxEdit.Image = newImg;
             Invoke((Action)(() =>
             {
                 pictureBoxEdit.Refresh();
                 pictureBoxStock.Refresh();
                 RefrechBarGraph();
             }));
         });
     }
     else
     {
         MessageBox.Show("Изображение не загружено.");
     }
 }
예제 #4
0
        public MainWindow()
        {
            InitializeComponent();
            imgEditor = new ImgEditor();

            bgWorker.DoWork                    += bgWorker_DoWork;
            bgWorker.RunWorkerCompleted        += bgWorker_WorkComplete;
            bgWorker.WorkerSupportsCancellation = true;

            // Настройки для гистограммы
            myChart.Visible = false;
            myChart.ChartAreas[0].AxisX.MajorGrid.Enabled = false;
            myChart.ChartAreas[0].AxisY.MajorGrid.Enabled = false;
            myChart.ChartAreas[0].BackColor      = Color.Transparent;
            myChart.ChartAreas[0].AxisX.Minimum  = 0;
            myChart.ChartAreas[0].AxisX.Maximum  = 255;
            myChart.ChartAreas[0].AxisX.Interval = 30;
            myChart.ChartAreas[0].AxisY.Minimum  = 0;

            // ComboBox с названиями фильтров
            ComboBoxFilters.Items.AddRange(new string[] { Filter.Blur.GetString(), Filter.Sharpening.GetString(),
                                                          Filter.Laplas.GetString(), Filter.Emboss135.GetString(), Filter.Emboss90.GetString() });
        }