Пример #1
0
        public ValueDialog(TypeConstants type)
        {
            //
            // Required for Windows Form Designer support
            //
            _typeProp = new TypeProp[]
            {
                new TypeProp(TypeConstants.ScaleFactor, DemosGlobalization.GetResxString(GetType(), "Resx_ScaleFactorPercent"), DemosGlobalization.GetResxString(GetType(), "Resx_ScaleFactor"), 0, true, 1, 1000, 1),
                new TypeProp(TypeConstants.PaintIntensity, DemosGlobalization.GetResxString(GetType(), "Resx_PaintIntensity"), DemosGlobalization.GetResxString(GetType(), "Resx_PaintIntensity"), 0, true, -100, 100, 10),
                new TypeProp(TypeConstants.PaintContrast, DemosGlobalization.GetResxString(GetType(), "Resx_PaintContrast"), DemosGlobalization.GetResxString(GetType(), "Resx_PaintContrast"), 0, true, -100, 100, 10),
                new TypeProp(TypeConstants.PaintGamma, DemosGlobalization.GetResxString(GetType(), "Resx_PaintGamma"), DemosGlobalization.GetResxString(GetType(), "Resx_PaintGamma"), 0, true, 10, 500, 1),
                new TypeProp(TypeConstants.AutoCrop, DemosGlobalization.GetResxString(GetType(), "Resx_AutoCrop"), DemosGlobalization.GetResxString(GetType(), "Resx_Threshold"), 0, true, 0, 244, 1),
                new TypeProp(TypeConstants.Average, DemosGlobalization.GetResxString(GetType(), "Resx_Average"), DemosGlobalization.GetResxString(GetType(), "Resx_Dimension"), 3, false, 3, 255, 1),
                new TypeProp(TypeConstants.Gaussian, DemosGlobalization.GetResxString(GetType(), "Resx_Gaussian"), DemosGlobalization.GetResxString(GetType(), "Resx_Radius"), 0, false, 1, 1000, 1),
                new TypeProp(TypeConstants.Median, DemosGlobalization.GetResxString(GetType(), "Resx_Median"), DemosGlobalization.GetResxString(GetType(), "Resx_Dimension"), 2, false, 2, 64, 1),
                new TypeProp(TypeConstants.Mosaic, DemosGlobalization.GetResxString(GetType(), "Resx_Mosac"), DemosGlobalization.GetResxString(GetType(), "Resx_Dimension"), 2, false, 2, 64, 1),
                new TypeProp(TypeConstants.Oilify, DemosGlobalization.GetResxString(GetType(), "Resx_Oilify"), DemosGlobalization.GetResxString(GetType(), "Resx_Dimension"), 2, false, 2, 255, 1),
                new TypeProp(TypeConstants.Posterize, DemosGlobalization.GetResxString(GetType(), "Resx_Posterize"), DemosGlobalization.GetResxString(GetType(), "Resx_Levels"), 2, false, 2, 64, 1),
                new TypeProp(TypeConstants.Sharpen, DemosGlobalization.GetResxString(GetType(), "Resx_Sharpen"), DemosGlobalization.GetResxString(GetType(), "Resx_Sharpness"), 0, false, -100, 100, 10),
                new TypeProp(TypeConstants.Min, DemosGlobalization.GetResxString(GetType(), "Resx_MinFilter"), DemosGlobalization.GetResxString(GetType(), "Resx_SampleSize"), 1, false, 1, 32, 1),
                new TypeProp(TypeConstants.Max, DemosGlobalization.GetResxString(GetType(), "Resx_MaxFilter"), DemosGlobalization.GetResxString(GetType(), "Resx_SampleSize"), 1, false, 1, 32, 1),
                new TypeProp(TypeConstants.HistoContrast, DemosGlobalization.GetResxString(GetType(), "Resx_HistoContrast"), DemosGlobalization.GetResxString(GetType(), "Resx_Contrast"), 0, false, -100, 100, 10),
                new TypeProp(TypeConstants.Hue, DemosGlobalization.GetResxString(GetType(), "Resx_Hue"), DemosGlobalization.GetResxString(GetType(), "Resx_Angle"), 0, false, -360, 360, 1),
                new TypeProp(TypeConstants.Solarize, DemosGlobalization.GetResxString(GetType(), "Resx_Solarize"), DemosGlobalization.GetResxString(GetType(), "Resx_Threshold"), 0, false, 0, 255, 1),
                new TypeProp(TypeConstants.Temperature, DemosGlobalization.GetResxString(GetType(), "Resx_Temperature"), DemosGlobalization.GetResxString(GetType(), "Resx_Threshold"), 0, false, -1000, 1000, 1)
            };
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            _type = type;
        }
Пример #2
0
        private void ReadDocumentStructure(PDFDocument document, PDFParseDocumentStructureOptions parseDocumentStructureOptions)
        {
            _readDocumentStructureLabel.Visible      = true;
            _readDocumentStructureValueLabel.Visible = true;
            Application.DoEvents();

            try
            {
                if (parseDocumentStructureOptions != PDFParseDocumentStructureOptions.None)
                {
                    using (WaitCursor wait = new WaitCursor())
                    {
                        document.ParseDocumentStructure(parseDocumentStructureOptions);
                        _readDocumentStructureValueLabel.Text = DemosGlobalization.GetResxString(GetType(), "resx_Finished");
                    }
                }
                else
                {
                    _readDocumentStructureValueLabel.Text = DemosGlobalization.GetResxString(GetType(), "resx_Skipped");
                }
            }
            catch (Exception ex)
            {
                _readDocumentStructureValueLabel.Text = DemosGlobalization.GetResxString(GetType(), "resx_Error");
                AddError(DemosGlobalization.GetResxString(GetType(), "resx_ReadingDocumentStructure"), ex);
            }

            Application.DoEvents();
        }
Пример #3
0
        private void PaletteDialog_Load(object sender, System.EventArgs e)
        {
            _lblPaletteInfo.Text = string.Format(DemosGlobalization.GetResxString(GetType(), "Resx_Count") + " {0}", Palette.Length);

            int xGrids = 16;
            int yGrids = Math.Max(1, Palette.Length / 16);

            SuspendLayout();

            _pnlPalette.Size = new Size(
                xGrids * _gridWidth + SystemInformation.Border3DSize.Width * 2,
                yGrids * _gridHeight + SystemInformation.Border3DSize.Height * 2);

            int d = _lblPaletteInfo.Top;

            ClientSize = new Size(
                Math.Max(d * 2 + _pnlPalette.Width, _minWidth),
                Math.Max(d * 5 + _pnlPalette.Height + _lblPaletteInfo.Height * 2 + _btnClose.Height, _minHeight));
            _lblPaletteInfo.Bounds  = new Rectangle(d, d, ClientSize.Width - d * 2, _lblPaletteInfo.Height);
            _lblCurrentColor.Bounds = new Rectangle(d, _lblPaletteInfo.Bottom + d, _lblPaletteInfo.Width, _lblCurrentColor.Height);
            _pnlPalette.Location    = new Point((ClientSize.Width - _pnlPalette.Width) / 2, _lblCurrentColor.Bottom + d);
            _btnClose.Location      = new Point((ClientSize.Width - _btnClose.Width) / 2, _pnlPalette.Bottom + d);

            ResumeLayout();
        }
Пример #4
0
        private void _btnDetectCells_Click(object sender, EventArgs e)
        {
            int selectedZoneIndex = (int)_tvZonesList.SelectedNode.Tag;

            try
            {
                _ocrPage.TableZoneManager.AutoDetectCells(selectedZoneIndex);
            }
            catch (Exception /*ex*/)
            {
            }

            OcrZoneCell[] cells = null;

            cells = _ocrPage.Zones.GetZoneCells(_ocrPage.Zones[selectedZoneIndex]);

            if (cells != null && cells.Length > 0)
            {
                _tvZonesList.SelectedNode.Nodes.Clear();
                for (int i = 0; i < cells.Length; i++)
                {
                    TreeNode addedNode = _tvZonesList.SelectedNode.Nodes.Add(DemosGlobalization.GetResxString(GetType(), "Resx_Cell") + (i + 1).ToString());
                    addedNode.Tag = cells[i];
                }

                _tvZonesList.SelectedNode.Expand();
                _viewerControl.ZonesUpdated();
                UpdateUIState();
            }

            _tvZonesList.Focus();
        }
      private bool CheckEncryption()
      {
         _encryptionLabel.Visible = true;
         Application.DoEvents();

         bool success = false;

         using (WaitCursor wait = new WaitCursor())
         {
            bool encrypted = PDFFile.IsEncrypted(_fileName);

            _encryptionValueLabel.Visible = true;
            _encryptionValueLabel.Text = encrypted ? DemosGlobalization.GetResxString(GetType(), "resx_Encrypted") : DemosGlobalization.GetResxString(GetType(), "resx_NotEncrypted");
            Application.DoEvents();

            if (encrypted)
            {
               using (GetPasswordDialog dlg = new GetPasswordDialog())
               {
                  if (dlg.ShowDialog(this) == DialogResult.OK)
                  {
                     success = true;
                     _password = dlg.Password;
                  }
               }
            }
            else
            {
               success = true;
            }
         }

         return success;
      }
Пример #6
0
 public CounterDialog(Form parent)
 {
     InitializeComponent();
     _loadingObject = true;
     _loadingText   = DemosGlobalization.GetResxString(GetType(), "Resx_Creating3DObj");
     Owner          = parent;
 }
Пример #7
0
        private void FindText(bool next)
        {
            string textToFind = _findToolStripTextBox.Text;
            bool   textFound  = _findTextHelper.FindText(_documentText, _currentPageNumber, _document.Pages.Count, _findToolStripTextBox.Text, next);

            if (textFound)
            {
                int textPageNumber = _findTextHelper.GotoPageNumber;
                _selectedText[textPageNumber] = _findTextHelper.GetSelectedWords();

                if (textPageNumber != _currentPageNumber)
                {
                    GotoPage(textPageNumber, false);
                }
            }
            else
            {
                for (int pageNumber = 1; pageNumber <= _document.Pages.Count; pageNumber++)
                {
                    _selectedText[pageNumber] = null;
                }

                Messager.ShowInformation(this, string.Format(DemosGlobalization.GetResxString(GetType(), "resx_NotFound"), textToFind));
            }

            _viewerControl.RasterImageViewer.Invalidate();
        }
Пример #8
0
        private void _twain_AcquirePage(object sender, TwainAcquirePageEventArgs e)
        {
            // This event occurs for each page acquired using the Acquire method
            try
            {
                if (_transferMode != TwainTransferMechanism.File)
                {
                    if (e.Image != null)
                    {
                        _scanCount++;
                        string childCaption;
                        childCaption = string.Format("Twain {0}{1}", DemosGlobalization.GetResxString(GetType(), "resx_ScannedPage"), _scanCount.ToString());

                        if (_cleanupAfterAcquire)
                        {
                            ApplyDocumentCleanupCommands(e.Image);
                        }
                        CreateChildForm(e.Image, childCaption);
                    }
                }
                else
                {
                    MessageBox.Show(this, DemosGlobalization.GetResxString(GetType(), "resx_AcquireToFileMsg"), DemosGlobalization.GetResxString(GetType(), "resx_AcquireToFile"));
                }
            }
            catch (Exception ex)
            {
                AddErrorToErrorList(ex.Message);
            }
        }
Пример #9
0
        private bool Init()
        {
            // Check support required to use this demo
            if (RasterSupport.IsLocked(RasterSupportType.Document))
            {
                Messager.ShowError(this, string.Format(DemosGlobalization.GetResxString(GetType(), "resx_DemoWillExit"), "RasterSupportType.Document"));
                return(false);
            }

            _rasterCodecs = new RasterCodecs();

            _demoOptions = DemoOptions.Load();

            _viewerControl.Visible = false;
            _pagesControl.Visible  = false;

            _documentAnnotations = new DocumentAnnotations(this);

            _viewerControl.BringToFront();

            UpdateUIState();

            LoadDefaultDocument();

            return(true);
        }
Пример #10
0
 private void _cmbResizeType_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (_cmbResizeType.SelectedItem.ToString() == "FavorBlack")
     {
         MessageBox.Show(DemosGlobalization.GetResxString(GetType(), "resx_FavorBlack"));
     }
 }
Пример #11
0
        private void _pnlPalette_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            for (int i = 0; i < Palette.Length; i++)
            {
                if (GetColorRectangle(i).Contains(e.X, e.Y))
                {
                    RasterColor color = Palette[i];
                    _lblCurrentColor.BackColor = Converters.ToGdiPlusColor(color);
                    Color foreColor = Color.FromArgb(
                        (byte)((color.R + 128) % 256),
                        (byte)((color.G + 128) % 256),
                        (byte)((color.B + 128) % 256));
                    _lblCurrentColor.ForeColor = foreColor;
                    _lblCurrentColor.Text      = string.Format(DemosGlobalization.GetResxString(GetType(), "Resx_Index") + " = {0} : {1}", i, color.ToString());
                    return;
                }
            }

            if (_lblCurrentColor.BackColor != SystemColors.Control)
            {
                _lblCurrentColor.BackColor = SystemColors.Control;
            }
            if (_lblCurrentColor.ForeColor != SystemColors.ControlText)
            {
                _lblCurrentColor.BackColor = SystemColors.ControlText;
            }
            if (_lblCurrentColor.Text != string.Empty)
            {
                _lblCurrentColor.Text = string.Empty;
            }
        }
Пример #12
0
        private void InitializeUI()
        {
            _cmbBitsPerPixel.Items.Add(1);
            _cmbBitsPerPixel.Items.Add(2);
            _cmbBitsPerPixel.Items.Add(3);
            _cmbBitsPerPixel.Items.Add(4);
            _cmbBitsPerPixel.Items.Add(5);
            _cmbBitsPerPixel.Items.Add(6);
            _cmbBitsPerPixel.Items.Add(7);
            _cmbBitsPerPixel.Items.Add(8);
            _cmbBitsPerPixel.Items.Add(12);
            _cmbBitsPerPixel.Items.Add(16);
            _cmbBitsPerPixel.Items.Add(24);
            _cmbBitsPerPixel.Items.Add(32);
            _cmbBitsPerPixel.Items.Add(48);
            _cmbBitsPerPixel.Items.Add(64);


            _cmbBitsPerPixel.SelectedIndexChanged += new EventHandler(_cmbBitsPerPixel_SelectedIndexChanged);
            _cmbBitsPerPixel.SelectedIndex         = _cmbBitsPerPixel.Items.IndexOf(_ColorResolutionCommand.BitsPerPixel);


            string[] names;
            names = Enum.GetNames(typeof(RasterDitheringMethod));
            foreach (string name in names)
            {
                _cmbDitherMethod.Items.Add(name);
            }
            _cmbDitherMethod.SelectedIndex = _cmbDitherMethod.Items.IndexOf(_ColorResolutionCommand.DitheringMethod.ToString());

            names = Enum.GetNames(typeof(ColorResolutionCommandPaletteFlags));
            foreach (string name in names)
            {
                if (name == "Fixed")
                {
                    _cmbPalette.Items.Add(name);
                }

                if (name == "Optimized")
                {
                    _cmbPalette.Items.Add(name);
                }
            }
            _cmbPalette.SelectedIndex = _cmbPalette.Items.IndexOf(_ColorResolutionCommand.PaletteFlags.ToString());

            _cmbColorOrder.Items.Add(DemosGlobalization.GetResxString(GetType(), "resx_BGR"));
            _cmbColorOrder.Items.Add(DemosGlobalization.GetResxString(GetType(), "resx_RGB"));
            _cmbColorOrder.SelectedIndex = 0;

            foreach (object i in _cmbBitsPerPixel.Items)
            {
                if (i.ToString() == _bPP.ToString())
                {
                    _cmbBitsPerPixel.SelectedItem = i;
                    break;
                }
            }
        }
Пример #13
0
 private void UpdateCaption()
 {
     if (_viewer.Image.PageCount > 1)
     {
         Text = string.Format("{0} - " + DemosGlobalization.GetResxString(GetType(), "Resx_Page") + " {1}:{2}", System.IO.Path.GetFileName(_name), _viewer.Image.Page, _viewer.Image.PageCount);
     }
     else
     {
         Text = string.Format("{0}", System.IO.Path.GetFileName(_name));
     }
 }
Пример #14
0
 private void UpdateMessageLabel(BarcodeReadOptions readOptions)
 {
     if (readOptions != null)
     {
         _messageLabel.Text = string.Format(DemosGlobalization.GetResxString(GetType(), "Resx_ReadingBarcode"), readOptions.FriendlyName, _currentPageNumber, _lastPageNumber);
     }
     else
     {
         _messageLabel.Text = string.Format(DemosGlobalization.GetResxString(GetType(), "Resx_ReadingBarcodes"), _currentPageNumber, _lastPageNumber);
     }
 }
Пример #15
0
        private void UpdateStatusBarText()
        {
            // update the status bar text
            switch (_captureType)
            {
            case CaptureType.ActiveWindow:
                _sbiText.Text = DemosGlobalization.GetResxString(GetType(), "Resx_CaptureActiveWindow");
                break;

            case CaptureType.ActiveClient:
                _sbiText.Text = DemosGlobalization.GetResxString(GetType(), "Resx_CaptureActiveClient");
                break;

            case CaptureType.FullScreen:
                _sbiText.Text = DemosGlobalization.GetResxString(GetType(), "Resx_CaptureFullScreen");
                break;

            case CaptureType.SelectedObject:
                _sbiText.Text = DemosGlobalization.GetResxString(GetType(), "Resx_CaptureSelectedObject");
                break;

            case CaptureType.MenuUnderCursor:
                _sbiText.Text = DemosGlobalization.GetResxString(GetType(), "Resx_CaptureMenuUnderCursor");
                break;

            case CaptureType.Area:
                _sbiText.Text = DemosGlobalization.GetResxString(GetType(), "Resx_CaptureSelectedArea");
                break;

            case CaptureType.WallPaper:
                _sbiText.Text = DemosGlobalization.GetResxString(GetType(), "Resx_CaptureWallpaper");
                break;

            case CaptureType.MouseCursor:
                _sbiText.Text = DemosGlobalization.GetResxString(GetType(), "Resx_CaptureMouseCursor");
                break;

            case CaptureType.WindowUnderCursor:
                _sbiText.Text = DemosGlobalization.GetResxString(GetType(), "Resx_CaptureWindowsUnderCursor");
                break;

            case CaptureType.FromExeTab:
                _sbiText.Text = DemosGlobalization.GetResxString(GetType(), "Resx_CaptureEXEFileTabbed");
                break;

            case CaptureType.FromExeTree:
                _sbiText.Text = DemosGlobalization.GetResxString(GetType(), "Resx_CaptureEXEFileTree");
                break;

            default:
                _sbiText.Text = DemosGlobalization.GetResxString(GetType(), "Resx_NoCapture");
                break;
            }
        }
Пример #16
0
 public CounterDialog(int count, int seriesIndex, Form parent)
 {
     InitializeComponent();
     Owner            = parent;
     _count           = count;
     _seriesIndex     = seriesIndex;
     _currentPercent  = 0;
     _progress.Value  = 0;
     _lblCounter.Text = DemosGlobalization.GetResxString(GetType(), "Resx_LoadingImage");
     _loadingObject   = false;
     _loadingText     = DemosGlobalization.GetResxString(GetType(), "Resx_Creating3DObj");
 }
Пример #17
0
        private bool GetValue(TextBox tb, int minimumValue, int maximumValue, out int value)
        {
            if (!int.TryParse(tb.Text, out value) || value < minimumValue || value > maximumValue)
            {
                tb.SelectAll();
                tb.Focus();
                MessageBox.Show(this, string.Format(DemosGlobalization.GetResxString(GetType(), "Resx_ErrorMessageValue"), minimumValue, maximumValue), DemosGlobalization.GetResxString(GetType(), "Resx_Error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(false);
            }

            return(true);
        }
Пример #18
0
        private void UpdatePageInfo()
        {
            StringBuilder sb = new StringBuilder();

            if (_document != null)
            {
                PDFDocumentPage page = _document.Pages[_currentPageNumber - 1];
                sb.AppendFormat(DemosGlobalization.GetResxString(GetType(), "resx_SizeBy"), page.WidthPixels, page.HeightPixels, page.WidthInches.ToString("F02"), page.HeightInches.ToString("F02"));
            }

            _pageInfoLabel.Text = sb.ToString();
        }
Пример #19
0
 private void _helpButton_Click(object sender, EventArgs e)
 {
     try
     {
         string helpFile = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), @"OCRSpellCheckEngines.html");
         Process.Start(helpFile);
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, DemosGlobalization.GetResxString(GetType(), "Resx_Help"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Пример #20
0
        private void LoadDefaultDocument()
        {
            string defaultDocumentFileName = Path.GetFullPath(Path.Combine(DemosGlobal.ImagesFolder, @"Leadtools.pdf"));

            if (File.Exists(defaultDocumentFileName))
            {
                if (Messager.ShowQuestion(this, string.Format(DemosGlobalization.GetResxString(GetType(), "resx_OpenDefault"), defaultDocumentFileName), MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    OpenDocument(defaultDocumentFileName);
                }
            }
        }
      private void GetFileType()
      {
         _fileTypeLabel.Visible = true;
         Application.DoEvents();

         using (WaitCursor wait = new WaitCursor())
         {
            PDFFileType fileType = PDFFile.GetPDFFileType(_fileName, true);
            _fileTypeValueLabel.Visible = true;
            _fileTypeValueLabel.Text = DemosGlobalization.GetResxString(GetType(), "resx_Finished");
            Application.DoEvents();
         }
      }
Пример #22
0
        private void UpdatePageInfo()
        {
            StringBuilder sb = new StringBuilder();

            if (_rasterImageViewer.Image != null)
            {
                RasterImage image = _rasterImageViewer.Image;

                sb.AppendFormat(DemosGlobalization.GetResxString(GetType(), "Resx_Size"), image.ImageWidth, image.ImageHeight, image.XResolution, image.YResolution, image.BitsPerPixel);
            }

            _pageInfoLabel.Text = sb.ToString();
        }
Пример #23
0
        private void InitializeUI()
        {
            _cmbFilter.Items.Add(DemosGlobalization.GetResxString(GetType(), "resx_VerticallyandHorizontally"));
            _cmbFilter.Items.Add(DemosGlobalization.GetResxString(GetType(), "resx_AllDirections1"));
            _cmbFilter.Items.Add(DemosGlobalization.GetResxString(GetType(), "resx_AllDirections2"));
            _cmbFilter.Items.Add(DemosGlobalization.GetResxString(GetType(), "resx_Diagonally"));
            _cmbFilter.Items.Add(DemosGlobalization.GetResxString(GetType(), "resx_Horizontally"));
            _cmbFilter.Items.Add(DemosGlobalization.GetResxString(GetType(), "resx_Vertically"));

            _cmbFilter.SelectedIndex = 0;

            _txbThreshold.Text = _Threshold.ToString();
            _txbMaskSize.Text  = _MaskSize.ToString();
        }
Пример #24
0
 private void panel1_MouseMove(object sender, MouseEventArgs e)
 {
     try
     {
         int shift = (int)_numRangeMin.Value;
         _level             = _rangesCount * e.X + shift;
         _lblLevel.Text     = DemosGlobalization.GetResxString(GetType(), "Resx_Level") + " = " + _level;
         _lblCount.Text     = DemosGlobalization.GetResxString(GetType(), "Resx_Count") + " = " + _value[e.X];
         _lblPercentil.Text = DemosGlobalization.GetResxString(GetType(), "Resx_Percentil") + " = " + Math.Round(getPercent() * 100, 2) + "%";
     }
     catch (Exception /*ex*/)
     {
     }
 }
Пример #25
0
        void _wiaSession_AcquireEvent(object sender, WiaAcquireEventArgs e)
        {
            string strInfoMsg;

            // Update the progress bar with the received percent value;
            if (_progressDlg.Visible)
            {
                // Show the user some information about the file we are acquiring
                // to (if the user chooses file transfer).

                if ((e.Flags & WiaAcquiredPageFlags.StartOfPage) == WiaAcquiredPageFlags.StartOfPage)
                {
                    if (_transferMode == WiaTransferMode.File)
                    {
                        strInfoMsg = string.Format(DemosGlobalization.GetResxString(GetType(), "Resx_TransferringToFile:") + "\n\n{0}", e.FileName);
                        _progressDlg.InformationString = strInfoMsg;
                    }
                }

                if (((e.Flags & WiaAcquiredPageFlags.StartOfPage) == WiaAcquiredPageFlags.StartOfPage) &&
                    ((e.Flags & WiaAcquiredPageFlags.EndOfPage) != WiaAcquiredPageFlags.EndOfPage))
                {
                    _progressDlg.Percent = 0;
                }
                else
                {
                    _progressDlg.Percent = (Int32)e.Percent;
                }

                Application.DoEvents();

                if (_progressDlg.Abort)
                {
                    e.Cancel = true;
                }
            }

            if (_transferMode != WiaTransferMode.File)
            {
                if (e.Image != null)
                {
                    _scanCount++;
                    string childCaption = string.Format(DemosGlobalization.GetResxString(GetType(), "Resx_WIAScannedPage") + " {0}", _scanCount.ToString());
                    CreateChildForm(e.Image, childCaption);

                    Application.DoEvents();
                }
            }
        }
Пример #26
0
 public IntensityDetectDialog( )
 {
     _channels = new ChannelType[]
     {
         new ChannelType(DemosGlobalization.GetResxString(GetType(), "Resx_Master"), IntensityDetectCommandFlags.Master),
         new ChannelType(DemosGlobalization.GetResxString(GetType(), "Resx_Red"), IntensityDetectCommandFlags.Red),
         new ChannelType(DemosGlobalization.GetResxString(GetType(), "Resx_Green"), IntensityDetectCommandFlags.Green),
         new ChannelType(DemosGlobalization.GetResxString(GetType(), "Resx_Blue"), IntensityDetectCommandFlags.Blue),
         new ChannelType(DemosGlobalization.GetResxString(GetType(), "Resx_RedAndGreen"), IntensityDetectCommandFlags.Red | IntensityDetectCommandFlags.Green),
         new ChannelType(DemosGlobalization.GetResxString(GetType(), "Resx_RedAndBlue"), IntensityDetectCommandFlags.Red | IntensityDetectCommandFlags.Blue),
         new ChannelType(DemosGlobalization.GetResxString(GetType(), "Resx_GreenAndBlue"), IntensityDetectCommandFlags.Green | IntensityDetectCommandFlags.Blue),
         new ChannelType(DemosGlobalization.GetResxString(GetType(), "Resx_RedGreenAndBlue"), IntensityDetectCommandFlags.Red | IntensityDetectCommandFlags.Green | IntensityDetectCommandFlags.Blue)
     };
     InitializeComponent();
 }
        private void _helpButton_Click(object sender, EventArgs e)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine(DemosGlobalization.GetResxString(GetType(), "Resx_Help1stLine"));
            sb.AppendLine();
            sb.AppendLine(DemosGlobalization.GetResxString(GetType(), "Resx_Help2ndLine"));
            sb.AppendLine();
            sb.AppendLine(DemosGlobalization.GetResxString(GetType(), "Resx_Help3rdLine"));
            sb.AppendLine(DemosGlobalization.GetResxString(GetType(), "Resx_Help4thLine"));
            sb.AppendLine();
            sb.AppendLine(DemosGlobalization.GetResxString(GetType(), "Resx_Help5thLine"));

            MessageBox.Show(this, sb.ToString(), DemosGlobalization.GetResxString(GetType(), "Resx_HelpMsg"), MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Пример #28
0
        private void InitializeUI()
        {
            _cmbColorType.Items.Add(DemosGlobalization.GetResxString(GetType(), "resx_RGBColorSpace"));
            _cmbColorType.Items.Add(DemosGlobalization.GetResxString(GetType(), "resx_YUVColorSpace"));

            _cmbColorType.SelectedIndex = 0;

            _Amount    = 0;
            _Radius    = 1;
            _Threshold = 0;

            _txbAmount.Text    = _Amount.ToString();
            _txbRadius.Text    = _Radius.ToString();
            _txbThreshold.Text = _Threshold.ToString();
        }
Пример #29
0
        private void UpdateControls( )
        {
            // Units
            string units;

            if (_cbUseDpi.Checked)
            {
                units = DemosGlobalization.GetResxString(GetType(), "Resx_1Over1000Inch");
            }
            else
            {
                units = DemosGlobalization.GetResxString(GetType(), "Resx_Pixels");
            }
            _lblUnitsWidth.Text  = units;
            _lblUnitsHeight.Text = units;
        }
        private void _btnOk_Click(object sender, System.EventArgs e)
        {
            if (_numMinWidth.Value >= _numMaxWidth.Value)
            {
                Messager.ShowWarning(this, DemosGlobalization.GetResxString(GetType(), "Resx_MinWidthWarning"));
                DialogResult = DialogResult.None;
                return;
            }

            if (_numMinHeight.Value >= _numMaxHeight.Value)
            {
                Messager.ShowWarning(this, "Resx_MinHeightWarning");
                DialogResult = DialogResult.None;
                return;
            }

            Flags = DotRemoveCommandFlags.None;

            if (_cbImageUnchanged.Checked)
            {
                Flags |= DotRemoveCommandFlags.ImageUnchanged;
            }
            if (_cbUseDiagonals.Checked)
            {
                Flags |= DotRemoveCommandFlags.UseDiagonals;
            }
            if (_cbUseDpi.Checked)
            {
                Flags |= DotRemoveCommandFlags.UseDpi;
            }
            if (_cbUseSize.Checked)
            {
                Flags |= DotRemoveCommandFlags.UseSize;
            }

            MinWidth  = (int)_numMinWidth.Value;
            MinHeight = (int)_numMinHeight.Value;
            MaxWidth  = (int)_numMaxWidth.Value;
            MaxHeight = (int)_numMaxHeight.Value;

            _initialFlags     = Flags;
            _initialMinWidth  = MinWidth;
            _initialMinHeight = MinHeight;
            _initialMaxWidth  = MaxWidth;
            _initialMaxHeight = MaxHeight;
        }