Exemple #1
0
        override public bool Execute()
        {
            DoubleParameter width = Parameters["Wdth"] as DoubleParameter;

            if (width != null)
            {
                _width = width.GetPixels(ActiveImage.Width);
            }

            DoubleParameter height = Parameters["Hght"] as DoubleParameter;

            if (height != null)
            {
                _height = height.GetPixels(ActiveImage.Height);
            }

            if (_constrainProportions)
            {
                if (_width != 0 && _height == 0)
                {
                    _height = ActiveImage.Height * _width / ActiveImage.Width;
                }
                if (_width == 0 && _height != 0)
                {
                    _width = ActiveImage.Width * _height / ActiveImage.Height;
                }
            }

            ActiveImage.Scale((int)_width, (int)_height);
            return(true);
        }