コード例 #1
0
        private void closingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            temp_image = new Bitmap(pictureBox1.Image);

            if (toolStripTextBox1.Text != "" && Convert.ToInt32(toolStripTextBox1.Text) > 0)
            {
                Filters filter = new ClosingFilter(MatrixFilter.generateUnitMatrix(Convert.ToInt32(toolStripTextBox1.Text)));
                backgroundWorker1.RunWorkerAsync(filter);
            }
            else
            {
                Filters filter = new ClosingFilter();
                backgroundWorker1.RunWorkerAsync(filter);
            }
        }
コード例 #2
0
        public override Bitmap processImage(Bitmap sourceImage, BackgroundWorker worker)
        {
            ClosingFilter closing;

            if (this.kernel == null)
            {
                closing = new ClosingFilter();
            }
            else
            {
                closing = new ClosingFilter(this.kernel);
            }
            SubtractionFilter subtraction = new SubtractionFilter(closing.processImage(sourceImage, worker));

            return(subtraction.processImage(sourceImage, worker));
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: BoytsovVA/CG_lab1
        private void closingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ClosingFilter filter = new ClosingFilter(tmp);
            Bitmap        newImage;

            if (tmp == null)
            {
                newImage = filter.ProcessImage(image);
            }
            else
            {
                newImage = filter.processImage(image);
            }


            if (backgroundWorker1.CancellationPending != true)
            {
                image = newImage;
            }
            pictureBox1.Image = image;
            pictureBox1.Refresh();
        }