Esempio n. 1
0
        public ColorResolutionDialog(RasterImage image, RasterPaintProperties paintProperties)
        {
            InitializeComponent();

            if (image != null)
            {
                CloneCommand clone = new CloneCommand();

                clone.Run(image);

                _originalImage = image;
                _afterImage    = clone.DestinationImage;

                _beforeViewer = new ImagePreviewCtrl(_originalImage, paintProperties, _lblBefore.Location, _lblBefore.Size);
                _afterViewer  = new ImagePreviewCtrl(_afterImage, paintProperties, _lblAfter.Location, _lblAfter.Size);

                Controls.Add(_beforeViewer);
                Controls.Add(_afterViewer);
                _beforeViewer.BringToFront();
                _afterViewer.BringToFront();

                _beforeViewer.PanImage += new EventHandler <PanImageEvent>(_beforeViewer_PanImage);
                _afterViewer.PanImage  += new EventHandler <PanImageEvent>(_afterViewer_PanImage);
            }
            else
            {
                _tsZoomLevel.Visible = false;
            }
        }
Esempio n. 2
0
        public MatchHistogramDialog(RasterImage image, RasterPaintProperties paintProperties, Form[] ViewerForms)
        {
            try
            {
                InitializeComponent();

                if (image != null)
                {
                    for (int i = 0; i < ViewerForms.Length; i++)
                    {
                        if ((image.BitsPerPixel == 24 && (((ViewerForm)ViewerForms[i]).Image.BitsPerPixel == 24) || ((ViewerForm)ViewerForms[i]).Image.BitsPerPixel == 8) || (image.BitsPerPixel == 8 && ((ViewerForm)ViewerForms[i]).Image.BitsPerPixel == 8))
                        {
                            _images.Add(((ViewerForm)ViewerForms[i]).Image);
                            _cmbREFImage.Items.Add(System.IO.Path.GetFileName(ViewerForms[i].Text));
                        }
                    }
                    _imageIndex = 0;
                    _REFImage   = _images[_imageIndex];
                    CloneCommand clone = new CloneCommand();
                    clone.Run(image);
                    _originalImage = image;
                    _DSTImage      = clone.DestinationImage;

                    _DSTViewer = new ImagePreviewCtrl(_DSTImage, paintProperties, _lblDST.Location, _lblDST.Size);
                    _REFViewer = new ImagePreviewCtrl(_REFImage, paintProperties, _lblREF.Location, _lblREF.Size);

                    Controls.Add(_DSTViewer);
                    Controls.Add(_REFViewer);
                    _DSTViewer.BringToFront();
                    _REFViewer.BringToFront();

                    _DSTViewer.PanImage       += new EventHandler <PanImageEvent>(_beforeViewer_PanImage);
                    _REFViewer.PanImage       += new EventHandler <PanImageEvent>(_afterViewer_PanImage);
                    _cmbREFImage.SelectedIndex = 0;
                }
                else
                {
                    _tsZoomLevel.Visible = false;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 3
0
        public BalanceColorsDialog(RasterImage image, RasterPaintProperties paintProperties)
        {
            try
            {
                InitializeComponent();

                if (image != null)
                {
                    CloneCommand clone = new CloneCommand();

                    clone.Run(image);

                    _originalImage = image;
                    _afterImage    = clone.DestinationImage;

                    _beforeViewer = new ImagePreviewCtrl(_originalImage, paintProperties, _lblBefore.Location, _lblBefore.Size);
                    _afterViewer  = new ImagePreviewCtrl(_afterImage, paintProperties, _lblAfter.Location, _lblAfter.Size);

                    Controls.Add(_beforeViewer);
                    Controls.Add(_afterViewer);
                    _beforeViewer.BringToFront();
                    _afterViewer.BringToFront();

                    _beforeViewer.PanImage += new EventHandler <PanImageEvent>(_beforeViewer_PanImage);
                    _afterViewer.PanImage  += new EventHandler <PanImageEvent>(_afterViewer_PanImage);
                }
                else
                {
                    _tsZoomLevel.Visible = false;
                }

                _redWeights           = new BalanceColorCommandFactor();
                _greenWeights         = new BalanceColorCommandFactor();
                _blueWeights          = new BalanceColorCommandFactor();
                _internalRedWeights   = new BalanceColorCommandFactor();
                _internalGreenWeights = new BalanceColorCommandFactor();
                _internalBlueWeights  = new BalanceColorCommandFactor();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public GammaAdjustmentDialog(RasterImage image, RasterPaintProperties paintProperties)
        {
            try
            {
                InitializeComponent();

                if (image != null)
                {
                    CloneCommand clone = new CloneCommand();

                    clone.Run(image);

                    _originalImage = image;
                    _afterImage    = clone.DestinationImage;

                    _beforeViewer = new ImagePreviewCtrl(_originalImage, paintProperties, _lblBefore.Location, _lblBefore.Size);
                    _afterViewer  = new ImagePreviewCtrl(_afterImage, paintProperties, _lblAfter.Location, _lblAfter.Size);

                    Controls.Add(_beforeViewer);
                    Controls.Add(_afterViewer);
                    _beforeViewer.BringToFront();
                    _afterViewer.BringToFront();

                    _beforeViewer.PanImage += new EventHandler <PanImageEvent>(_beforeViewer_PanImage);
                    _afterViewer.PanImage  += new EventHandler <PanImageEvent>(_afterViewer_PanImage);
                }
                else
                {
                    _tsZoomLevel.Visible = false;
                }

                _internalGammaValue = 10;
                _gamma = 10;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }