Esempio n. 1
0
        public GammaCorrectDialog()
        {
            InitializeComponent();
            _GammaCorrectCommand = new GammaCorrectCommand();

            //Set command default values
            _Gamma = 250;
            InitializeUI();
        }
Esempio n. 2
0
        public static void GammaCorrect(RasterImage image, params string[] parameters)
        {
            if (parameters.Length >= 1)
            {
                int value;

                if (int.TryParse(parameters[0], out value))
                {
                    GammaCorrectCommand cmd = new GammaCorrectCommand();

                    cmd.Gamma = value;
                    cmd.Run(image);
                }
            }
        }
        protected virtual bool DoEffect(ref RasterImage effectedImage)
        {
            try
            {
                GammaCorrectCommand command = new GammaCorrectCommand(_internalGammaValue);

                command.Progress += new EventHandler <RasterCommandProgressEventArgs>(command_Progress);

                if (RasterImageChangedFlags.None == command.Run(effectedImage))
                {
                    return(false);
                }

                //Reset progress bar
                _pbProgress.Value = 0;

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }