Exemplo n.º 1
0
        private void _btnOk_Click(object sender, EventArgs e)
        {
            if (_numLow.Value >= _numHigh.Value)
            {
                Messager.ShowWarning(this, _lblMsg.Text);
                DialogResult = DialogResult.None;
                return;
            }

            Low            = (int)_numLow.Value;
            High           = (int)_numHigh.Value;
            _InColorLevel  = (int)_numInColorLevel.Value;
            _OutColorLevel = (int)_numOutColorLevel.Value;

            ChannelType ct = (ChannelType)_cbChannel.SelectedItem;

            Channel = ct.Flags;

            _initialLow     = Low;
            _initialHigh    = High;
            _initialChannel = 0;

            if (_isGray)
            {
                OutColor = new RasterColor(_OutColorLevel, _OutColorLevel, _OutColorLevel);
                InColor  = new RasterColor(_InColorLevel, _InColorLevel, _InColorLevel);
            }
        }
Exemplo n.º 2
0
        private void IntensityDetectDailog_Load(object sender, EventArgs e)
        {
            IntensityDetectCommand command = new IntensityDetectCommand();

            _initialLow  = command.LowThreshold;
            _initialHigh = command.HighThreshold;

            if (_initialLow >= _initialHigh)
            {
                _initialHigh = _initialLow + 1;
            }

            _InColorLevel   = 0;
            _OutColorLevel  = 0;
            _initialChannel = command.Channel;

            Low     = _initialLow;
            High    = _initialHigh;
            Channel = _initialChannel;

            _numLow.Value            = Low;
            _numHigh.Value           = High;
            _numOutColorLevel.Value  = 0;
            _numInColorLevel.Value   = 0;
            _pnlInRevColor.BackColor = _pnlOutRevColor.BackColor = Color.Black;

            if (_isGray)
            {
                _pnlColor.Visible = false;
                _pnlLevel.Visible = true;
            }
            else
            {
                _pnlColor.Visible = true;
                _pnlLevel.Visible = false;
            }


            foreach (ChannelType i in _channels)
            {
                _cbChannel.Items.Add(i);
                if (i.Flags == Channel)
                {
                    _cbChannel.SelectedItem = i;
                }
            }

            if (_cbChannel.SelectedItem == null)
            {
                _cbChannel.SelectedIndex = 0;
            }
        }
Exemplo n.º 3
0
        private void IntensityDetectDialog_Load(object sender, System.EventArgs e)
        {
            //Set command default values

            if (_firstTimer)
            {
                _firstTimer = false;
                IntensityDetectCommand command = new IntensityDetectCommand();
                _initialLow  = 128;
                _initialHigh = 255;

                if (_initialLow >= _initialHigh)
                {
                    _initialHigh = _initialLow + 1;
                }

                _initialInColor  = command.InColor;
                _initialOutColor = command.OutColor;
                _initialChannel  = command.Channel;
            }

            Low      = _initialLow;
            High     = _initialHigh;
            InColor  = _initialInColor;
            OutColor = _initialOutColor;
            Channel  = _initialChannel;

            _numLow.Value  = Low;
            _numHigh.Value = High;

            foreach (ChannelType i in _channels)
            {
                _cbChannel.Items.Add(i);
                if (i.Flags == Channel)
                {
                    _cbChannel.SelectedItem = i;
                }
            }

            if (_cbChannel.SelectedItem == null)
            {
                _cbChannel.SelectedIndex = 0;
            }
        }
Exemplo n.º 4
0
        private void _btnOk_Click(object sender, System.EventArgs e)
        {
            if (_numLow.Value >= _numHigh.Value)
            {
                Messager.ShowWarning(this, _lblMsg.Text);
                DialogResult = DialogResult.None;
                return;
            }

            Low  = (int)_numLow.Value;
            High = (int)_numHigh.Value;

            ChannelType ct = (ChannelType)_cbChannel.SelectedItem;

            Channel = ct.Flags;

            _initialLow      = Low;
            _initialHigh     = High;
            _initialInColor  = InColor;
            _initialOutColor = OutColor;
            _initialChannel  = 0;
        }
Exemplo n.º 5
0
 public ChannelType(string n, IntensityDetectCommandFlags f)
 {
     Name  = n;
     Flags = f;
 }