Beispiel #1
0
        private void MyOcrProgressCallback(IOcrProgressData data)
        {
            // Update the description label
            int pageNumber = data.CurrentPageIndex + 1;
            int pagesCount = data.LastPageIndex + 1;

            string str        = string.Format("{0} - Page {1} of {2}", data.Operation.ToString(), pageNumber, pagesCount);
            int    percentage = data.Percentage;

            if (InvokeRequired)
            {
                BeginInvoke(new DoUpdateStatusDelegate(DoUpdateStatus), new object[] { str, percentage });
            }
            else
            {
                DoUpdateStatus(str, percentage);
            }

            if (_isCanceled)
            {
                data.Status = OcrProgressStatus.Abort;
            }

            Application.DoEvents();
        }
Beispiel #2
0
        private void OcrProgress(IOcrProgressData data)
        {
            if (!_canceled)
            {
                if (InvokeRequired)
                {
                    BeginInvoke(new UpdateOcrProgressDelegate(DoUpdateOcrProgress), new object[] { "OCR operation: " + data.Operation.ToString() });
                }
                else
                {
                    DoUpdateOcrProgress("OCR operation: " + data.Operation.ToString());
                }

                Application.DoEvents();
            }
            else
            {
                data.Status = OcrProgressStatus.Abort;
            }
        }