Пример #1
0
        public override bool Execute()
        {
            double _x, _y, _width, _height;
              GetBounds(_objc, out _x, out _y, out _width, out _height);

              RectangleSelectTool tool = new RectangleSelectTool(ActiveImage);
              tool.Select(_x, _y, _width, _height, ChannelOps.Replace, false, 0);
              RememberCurrentSelection();

              return true;
        }
Пример #2
0
        override public bool Execute()
        {
            GetBounds(_objc, out double _x, out double _y, out double _width, out double _height);

            var tool = new RectangleSelectTool(ActiveImage);

            tool.Select(_x, _y, _width, _height, ChannelOps.Replace, false, 0);
            RememberCurrentSelection();

            return(true);
        }
Пример #3
0
        public override bool Execute()
        {
            double x = GetByName("Left");
              double y = GetByName("Top");
              double width = GetByName("Rght") - x + 1;
              double height = GetByName("Btom") - y + 1;

              var tool = new RectangleSelectTool(ActiveImage);
              tool.Select(x, y, width, height, ChannelOps.Subtract, false, 0);

              return true;
        }
Пример #4
0
        override public bool Execute()
        {
            double x      = GetByName("Left");
            double y      = GetByName("Top");
            double width  = GetByName("Rght") - x + 1;
            double height = GetByName("Btom") - y + 1;

            var tool = new RectangleSelectTool(ActiveImage);

            tool.Select(x, y, width, height, ChannelOps.Subtract, false, 0);

            return(true);
        }
Пример #5
0
        override public bool Execute()
        {
            var top    = _objc.Parameters["Top"] as DoubleParameter;
            var left   = _objc.Parameters["Left"] as DoubleParameter;
            var bottom = _objc.Parameters["Btom"] as DoubleParameter;
            var right  = _objc.Parameters["Rght"] as DoubleParameter;

            double x      = left.Value;
            double y      = top.Value;
            double width  = right.Value - x + 1;
            double height = bottom.Value - y + 1;

            var tool = new RectangleSelectTool(ActiveImage);

            tool.Select(x, y, width, height, ChannelOps.Add, false, 0);

            return(true);
        }
Пример #6
0
        public override bool Execute()
        {
            DoubleParameter top = _objc.Parameters["Top"] as DoubleParameter;
              DoubleParameter left = _objc.Parameters["Left"] as DoubleParameter;
              DoubleParameter bottom = _objc.Parameters["Btom"]
            as DoubleParameter;
              DoubleParameter right = _objc.Parameters["Rght"] as DoubleParameter;

              double x = left.Value;
              double y = top.Value;
              double width = right.Value - x + 1;
              double height = bottom.Value - y + 1;

              RectangleSelectTool tool = new RectangleSelectTool(ActiveImage);
              tool.Select(x, y, width, height, ChannelOps.Add, false, 0);

              return true;
        }
        public override bool Execute()
        {
            DoubleParameter width = Parameters["Wdth"] as DoubleParameter;
              double widthPercentage = (width == null) ? 100 : width.Value;

              DoubleParameter height = Parameters["Hght"] as DoubleParameter;
              double heightPercentage = (height == null) ? 100 : height.Value;

              bool nonEmpty;
              Rectangle bounds = ActiveImage.Selection.Bounds(out nonEmpty);
              double newWidth = bounds.Width * widthPercentage / 100;
              double newHeight = bounds.Height * heightPercentage / 100;

              // TODO: always rescale from the center
              double x = bounds.X1 + (bounds.Width - newWidth) / 2;
              double y = bounds.Y1 + (bounds.Height - newHeight) / 2;

              // TODO: for now assume that the selection is always rectangular
              RectangleSelectTool tool = new RectangleSelectTool(ActiveImage);
              tool.Select(x, y, newWidth, newHeight, ChannelOps.Replace, false, 0);

              return true;
        }
        override public bool Execute()
        {
            DoubleParameter width           = Parameters["Wdth"] as DoubleParameter;
            double          widthPercentage = (width == null) ? 100 : width.Value;

            DoubleParameter height           = Parameters["Hght"] as DoubleParameter;
            double          heightPercentage = (height == null) ? 100 : height.Value;

            bool      nonEmpty;
            Rectangle bounds    = ActiveImage.Selection.Bounds(out nonEmpty);
            double    newWidth  = bounds.Width * widthPercentage / 100;
            double    newHeight = bounds.Height * heightPercentage / 100;

            // TODO: always rescale from the center
            double x = bounds.X1 + (bounds.Width - newWidth) / 2;
            double y = bounds.Y1 + (bounds.Height - newHeight) / 2;

            // TODO: for now assume that the selection is always rectangular
            RectangleSelectTool tool = new RectangleSelectTool(ActiveImage);

            tool.Select(x, y, newWidth, newHeight, ChannelOps.Replace, false, 0);

            return(true);
        }