Ejemplo n.º 1
0
        private void _btnOk_Click(object sender, System.EventArgs e)
        {
            Flags = LineRemoveCommandFlags.None;

            if (_cbImageUnchanged.Checked)
            {
                Flags |= LineRemoveCommandFlags.ImageUnchanged;
            }
            if (_cbRemoveEntire.Checked)
            {
                Flags |= LineRemoveCommandFlags.RemoveEntire;
            }
            if (_cbUseVariance.Checked)
            {
                Flags |= LineRemoveCommandFlags.UseVariance;
            }
            if (_cbUseGap.Checked)
            {
                Flags |= LineRemoveCommandFlags.UseGap;
            }
            if (_cbUseDpi.Checked)
            {
                Flags |= LineRemoveCommandFlags.UseDpi;
            }

            if (_rbHorizontal.Checked)
            {
                Remove = LineRemoveCommandType.Horizontal;
            }
            if (_rbVertical.Checked)
            {
                Remove = LineRemoveCommandType.Vertical;
            }

            GapLength      = (int)_numGapLength.Value;
            LineVariance   = (int)_numLineVariance.Value;
            MaxLineWidth   = (int)_numMaxLineWidth.Value;
            MaxWallPercent = (int)_numMaxWallPercent.Value;
            MinLineLength  = (int)_numMinLineLength.Value;
            Wall           = (int)_numWall.Value;

            _initialFlags          = Flags;
            _initialRemove         = Remove;
            _initialGapLength      = GapLength;
            _initialLineVariance   = LineVariance;
            _initialMaxLineWidth   = MaxLineWidth;
            _initialMaxWallPercent = MaxWallPercent;
            _initialMinLineLength  = MinLineLength;
            _initialWall           = Wall;
        }
        public void LineRemoveCommand(LineRemoveCommandType type, RasterImage image)
        {
            LineRemoveCommand command = new LineRemoveCommand
            {
                Type               = type,
                Flags              = LineRemoveCommandFlags.RemoveEntire,
                MaximumLineWidth   = 6,
                MinimumLineLength  = 30,
                MaximumWallPercent = 10,
                Wall               = 10
            };

            command.Run(image);
        }
Ejemplo n.º 3
0
        private void LineRemoveDialog_Load(object sender, System.EventArgs e)
        {
            if (_firstTimer)
            {
                _firstTimer = false;
                LineRemoveCommand command = new LineRemoveCommand();
                _initialFlags          = command.Flags;
                _initialRemove         = command.Type;
                _initialGapLength      = command.GapLength;
                _initialLineVariance   = command.Variance;
                _initialMaxLineWidth   = command.MaximumLineWidth;
                _initialMaxWallPercent = command.MaximumWallPercent;
                _initialMinLineLength  = command.MinimumLineLength;
                _initialWall           = command.Wall;
            }

            Flags          = _initialFlags;
            Remove         = _initialRemove;
            GapLength      = _initialGapLength;
            LineVariance   = _initialLineVariance;
            MaxLineWidth   = _initialMaxLineWidth;
            MaxWallPercent = _initialMaxWallPercent;
            MinLineLength  = _initialMinLineLength;
            Wall           = _initialWall;

            _cbImageUnchanged.Checked = (Flags & LineRemoveCommandFlags.ImageUnchanged) == LineRemoveCommandFlags.ImageUnchanged;
            _cbRemoveEntire.Checked   = (Flags & LineRemoveCommandFlags.RemoveEntire) == LineRemoveCommandFlags.RemoveEntire;
            _cbUseVariance.Checked    = (Flags & LineRemoveCommandFlags.UseVariance) == LineRemoveCommandFlags.UseVariance;
            _cbUseGap.Checked         = (Flags & LineRemoveCommandFlags.UseGap) == LineRemoveCommandFlags.UseGap;
            _cbUseDpi.Checked         = (Flags & LineRemoveCommandFlags.UseDpi) == LineRemoveCommandFlags.UseDpi;

            _rbHorizontal.Checked = Remove == LineRemoveCommandType.Horizontal;
            _rbVertical.Checked   = Remove == LineRemoveCommandType.Vertical;

            _numGapLength.Value      = GapLength;
            _numLineVariance.Value   = LineVariance;
            _numMaxLineWidth.Value   = MaxLineWidth;
            _numMaxWallPercent.Value = MaxWallPercent;
            _numMinLineLength.Value  = MinLineLength;
            _numWall.Value           = Wall;

            UpdateControls();
        }