Beispiel #1
0
        protected override void bulkOCRToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (backgroundWorkerBulk != null && backgroundWorkerBulk.IsBusy)
            {
                backgroundWorkerBulk.CancelAsync();
                return;
            }
            if (bulkDialog == null)
            {
                bulkDialog = new BulkDialog();
            }

            bulkDialog.InputFolder  = inputFolder;
            bulkDialog.OutputFolder = outputFolder;
            bulkDialog.OutputFormat = outputFormat;

            if (bulkDialog.ShowDialog() == DialogResult.OK)
            {
                inputFolder  = bulkDialog.InputFolder;
                outputFolder = bulkDialog.OutputFolder;
                outputFormat = bulkDialog.OutputFormat;

                this.toolStripStatusLabel1.Text = Properties.Resources.OCRrunning;
                this.Cursor = Cursors.WaitCursor;
                this.pictureBox1.UseWaitCursor     = true;
                this.textBox1.Cursor               = Cursors.WaitCursor;
                this.toolStripProgressBar1.Enabled = true;
                this.toolStripProgressBar1.Visible = true;
                this.toolStripProgressBar1.Style   = ProgressBarStyle.Marquee;
                this.bulkOCRToolStripMenuItem.Text = Properties.Resources.CancelBulkOCR;

                if (this.statusForm.IsDisposed)
                {
                    this.statusForm = new StatusForm();
                    statusForm.Text = Properties.Resources.BulkProcessStatus;
                }
                if (!this.statusForm.Visible)
                {
                    this.statusForm.Show();
                }
                else if (this.statusForm.WindowState == FormWindowState.Minimized)
                {
                    this.statusForm.WindowState = FormWindowState.Normal;
                }
                this.statusForm.BringToFront();
                this.statusForm.TextBox.AppendText("\t-- " + Properties.Resources.Beginning_of_task + " --" + Environment.NewLine);

                // start bulk OCR
                stopWatch.Start();
                this.backgroundWorkerBulk.RunWorkerAsync();
            }
        }
Beispiel #2
0
        private void backgroundWorkerBulk_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            if (this.statusForm.IsDisposed)
            {
                this.statusForm = new StatusForm();
                statusForm.Text = Properties.Resources.BulkProcessStatus;
            }
            if (!this.statusForm.Visible)
            {
                this.statusForm.Show();
            }

            this.statusForm.TextBox.AppendText((string)e.UserState + Environment.NewLine);
        }
Beispiel #3
0
        private void OnTimedEvent(Object sender, EventArgs e)
        {
            if (queue.Count > 0)
            {
                if (this.statusForm.IsDisposed)
                {
                    this.statusForm = new StatusForm();
                    statusForm.Text = Properties.Resources.BatchProcessStatus;
                }
                if (!this.statusForm.Visible)
                {
                    this.statusForm.Show();
                }

                Thread t = new Thread(new ThreadStart(AutoOCR));
                t.Start();
            }
        }
Beispiel #4
0
 public GUIWithBatch()
 {
     InitializeComponent();
     statusForm      = new StatusForm();
     statusForm.Text = Properties.Resources.BatchProcessStatus;
 }
Beispiel #5
0
        protected override void bulkOCRToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (backgroundWorkerBulk != null && backgroundWorkerBulk.IsBusy)
            {
                backgroundWorkerBulk.CancelAsync();
                return;
            }
            if (bulkDialog == null)
            {
                bulkDialog = new BulkDialog();
            }

            bulkDialog.InputFolder = inputFolder;
            bulkDialog.OutputFolder = outputFolder;
            bulkDialog.OutputFormat = outputFormat;

            if (bulkDialog.ShowDialog() == DialogResult.OK)
            {
                inputFolder = bulkDialog.InputFolder;
                outputFolder = bulkDialog.OutputFolder;
                outputFormat = bulkDialog.OutputFormat;

                this.toolStripStatusLabel1.Text = Properties.Resources.OCRrunning;
                this.Cursor = Cursors.WaitCursor;
                this.pictureBox1.UseWaitCursor = true;
                this.textBox1.Cursor = Cursors.WaitCursor;
                this.toolStripProgressBar1.Enabled = true;
                this.toolStripProgressBar1.Visible = true;
                this.toolStripProgressBar1.Style = ProgressBarStyle.Marquee;
                this.bulkOCRToolStripMenuItem.Text = Properties.Resources.CancelBulkOCR;

                if (this.statusForm.IsDisposed)
                {
                    this.statusForm = new StatusForm();
                    statusForm.Text = Properties.Resources.BulkProcessStatus;
                }
                if (!this.statusForm.Visible)
                {
                    this.statusForm.Show();
                }
                else if (this.statusForm.WindowState == FormWindowState.Minimized)
                {
                    this.statusForm.WindowState = FormWindowState.Normal;
                }
                this.statusForm.BringToFront();
                this.statusForm.TextBox.AppendText("\t-- " + Properties.Resources.Beginning_of_task + " --" + Environment.NewLine);

                // start bulk OCR
                stopWatch.Start();
                this.backgroundWorkerBulk.RunWorkerAsync();
            }
        }
Beispiel #6
0
 public GUIWithBulkOCR()
 {
     InitializeComponent();
     statusForm = new StatusForm();
     statusForm.Text = Properties.Resources.BulkProcessStatus;
 }
Beispiel #7
0
        private void backgroundWorkerBulk_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            if (this.statusForm.IsDisposed)
            {
                this.statusForm = new StatusForm();
                statusForm.Text = Properties.Resources.BulkProcessStatus;
            }
            if (!this.statusForm.Visible)
            {
                this.statusForm.Show();
            }

            this.statusForm.TextBox.AppendText((string)e.UserState + Environment.NewLine);
        }
Beispiel #8
0
 public GUIWithSettings()
 {
     InitializeComponent();
     statusForm = new StatusForm();
     statusForm.Text = Properties.Resources.BatchProcessStatus;
 }
Beispiel #9
0
        private void OnTimedEvent(Object sender, EventArgs e)
        {
            if (queue.Count > 0)
            {
                if (this.statusForm.IsDisposed)
                {
                    this.statusForm = new StatusForm();
                    statusForm.Text = Properties.Resources.BatchProcessStatus;
                }
                if (!this.statusForm.Visible)
                {
                    this.statusForm.Show();
                }

                Thread t = new Thread(new ThreadStart(AutoOCR));
                t.Start();
            }
        }