コード例 #1
0
ファイル: GUIWithImage.cs プロジェクト: nguyenq/VietOCR3.NET
        protected override void brightenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (imageList == null)
            {
                MessageBox.Show(this, Properties.Resources.LoadImage, strProgName);
                return;
            }
            TrackbarDialog dialog = new TrackbarDialog();
            dialog.LabelText = Properties.Resources.Brightness;
            dialog.ValueUpdated += new TrackbarDialog.HandleValueChange(UpdatedBrightness);

            originalImage = imageList[imageIndex];
            stack.Push(originalImage);
            if (dialog.ShowDialog() == DialogResult.Cancel)
            {
                // restore original image
                imageList[imageIndex] = originalImage;
                this.pictureBox1.Image = new Bitmap(originalImage);
            }
        }
コード例 #2
0
ファイル: GUIWithImage.cs プロジェクト: hoanganhmta/OCRSoft
        protected override void brightenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (imageList == null)
            {
                MessageBox.Show(this, Properties.Resources.LoadImage, strProgName);
                return;
            }
            TrackbarDialog dialog = new TrackbarDialog();

            dialog.LabelText     = Properties.Resources.Brightness;
            dialog.ValueUpdated += new TrackbarDialog.HandleValueChange(UpdatedBrightness);

            originalImage = imageList[imageIndex];
            stack.Push(originalImage);
            if (dialog.ShowDialog() == DialogResult.Cancel)
            {
                // restore original image
                imageList[imageIndex]  = originalImage;
                this.pictureBox1.Image = new Bitmap(originalImage);
            }
        }
コード例 #3
0
ファイル: GUIWithImage.cs プロジェクト: ADTC/VietOCR
 private void UpdatedContrast(object sender, TrackbarDialog.ValueChangedEventArgs e)
 {
     Image image = ImageHelper.Contrast(originalImage, e.NewValue * 0.04f);
     if (image != null)
     {
         imageList[imageIndex] = image;
         this.pictureBox1.Image = new Bitmap(image);
     }
 }