/// <summary>
        /// Returns the image processing command.
        /// </summary>
        /// <returns>The image processing command.</returns>
        public override ProcessingCommandBase GetProcessingCommand()
        {
            ClearImageCommand command = ImageProcessingCommandFactory.CreateClearImageCommand(_imageViewer.Image);

            command.FillColor = fillColorPanelControl.Color;
            return(command);
        }
Пример #2
0
        /// <summary>
        /// Executes the DrawImageCommand command.
        /// </summary>
        public void ExecuteDrawImageCommand()
        {
            // create the processing command
            DrawImageCommand command = ImageProcessingCommandFactory.CreateDrawImageCommand(_viewer.Image);

            // set properties of command
            PropertyGridForm propertyGridForm = new PropertyGridForm(command, "Draw Image Command Properties", true);

            if (propertyGridForm.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            // save a reference to the overlay image, image will be disposed when command is finished
            _overlayImage = command.OverlayImage;

            // execute the command
            ExecuteProcessingCommand(command, true);
        }
Пример #3
0
        /// <summary>
        /// Executes the ColorBlendCommand command.
        /// </summary>
        public void ExecuteColorBlendCommand()
        {
            ColorBlendForm dlg;

            try
            {
                dlg = new ColorBlendForm(_viewer, ViewerSelectionRectangle, _blendColor, _blendMode);
            }
            catch (ImageProcessingException ex)
            {
                MessageBox.Show(ex.Message, "Image processing exception", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (dlg.ShowProcessingDialog())
            {
                _blendMode  = dlg.BlendMode;
                _blendColor = dlg.BlendColor;
                ColorBlendCommand command = ImageProcessingCommandFactory.CreateColorBlendCommand(_viewer.Image);
                command.BlendingMode = _blendMode;
                command.BlendColor   = _blendColor;
                ExecuteProcessingCommand(command);
            }
        }