Пример #1
0
        private void UpdateSymbolControls()
        {
            _ignoreChanges            = true;
            cmbScaleMode.SelectedItem = _symbolizer.ScaleMode.ToString();
            chkSmoothing.Checked      = _symbolizer.Smoothing;
            _disableUnitWarning       = true;
            cmbUnits.SelectedItem     = _symbolizer.Units.ToString();
            _disableUnitWarning       = false;
            ICharacterSymbol cs = ccSymbols.SelectedSymbol as ICharacterSymbol;

            if (cs != null)
            {
                cmbSymbolType.SelectedItem = "Character";
                UpdateCharacterSymbolControls(cs);
            }

            ISimpleSymbol ss = ccSymbols.SelectedSymbol as ISimpleSymbol;

            if (ss != null)
            {
                cmbSymbolType.SelectedItem = "Simple";
                UpdateSimpleSymbolControls(ss);
            }

            IPictureSymbol ps = ccSymbols.SelectedSymbol as IPictureSymbol;

            if (ps != null)
            {
                cmbSymbolType.SelectedItem = "Picture";
                UpdatePictureSymbolControls(ps);
            }

            _ignoreChanges = false;
        }
Пример #2
0
        private void BtnBrowseImageClick(object sender, EventArgs e)
        {
            if (_ignoreChanges)
            {
                return;
            }

            using (OpenFileDialog ofd = new OpenFileDialog
            {
                Filter = @"Image Files|*.bmp;*.jpg;*.gif;*.tif;*.png;*.ico"
            })
            {
                if (ofd.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                IPictureSymbol ps = ccSymbols.SelectedSymbol as IPictureSymbol;
                if (ps != null)
                {
                    ps.ImageFilename      = ofd.FileName;
                    txtImageFilename.Text = Path.GetFileName(ofd.FileName);
                }

                UpdatePreview();
            }
        }
Пример #3
0
        private void SldImageOpacityValueChanged(object sender, EventArgs e)
        {
            if (_ignoreChanges)
            {
                return;
            }
            IPictureSymbol ps = ccSymbols.SelectedSymbol as IPictureSymbol;

            if (ps != null)
            {
                ps.Opacity = (float)sldImageOpacity.Value;
                UpdatePreview();
            }
        }
Пример #4
0
        private void UpdatePictureSymbolControls(IPictureSymbol ps)
        {
            angleControl.Angle = -(int)ps.Angle;
            dbxOffsetX.Value   = ps.Offset.X;
            dbxOffsetY.Value   = ps.Offset.Y;
            sizeControl.Symbol = ps;

            sldImageOpacity.Value = ps.Opacity;
            txtImageFilename.Text = Path.GetFileName(ps.ImageFilename);

            chkUseOutlinePicture.Checked          = ps.UseOutline;
            cbOutlineColorPicture.Color           = ps.OutlineColor;
            sldOutlineOpacityPicture.Value        = ps.OutlineOpacity;
            sldOutlineOpacityPicture.MaximumColor = Color.FromArgb(255, ps.OutlineColor);
            dbxOutlineWidth.Value = ps.OutlineWidth;
        }
Пример #5
0
        private void UpdateSymbolControls()
        {
            _ignoreChanges             = true;
            cmbScaleMode.SelectedIndex = Global.GetEnumIndex(_symbolizer.ScaleMode);
            chkSmoothing.Checked       = _symbolizer.Smoothing;
            _disableUnitWarning        = true;
            cmbUnits.SelectedIndex     = Global.GetEnumIndex(_symbolizer.Units);
            _disableUnitWarning        = false;
            ICharacterSymbol cs = ccSymbols.SelectedSymbol as ICharacterSymbol;

            if (cs != null)
            {
                cmbSymbolType.SelectedItem = "Character";
                UpdateCharacterSymbolControls(cs);
            }

            cmbSymbolType.SelectedIndex = Global.GetEnumIndex(ccSymbols.SelectedSymbol.SymbolType);
            switch (ccSymbols.SelectedSymbol.SymbolType)
            {
            case SymbolType.Character:
                break;

            case SymbolType.Custom:
                break;

            case SymbolType.Picture:
                IPictureSymbol ps = ccSymbols.SelectedSymbol as IPictureSymbol;
                UpdatePictureSymbolControls(ps);
                break;

            case SymbolType.Simple:
                ISimpleSymbol ss = ccSymbols.SelectedSymbol as ISimpleSymbol;
                UpdateSimpleSymbolControls(ss);
                break;
            }

            _ignoreChanges = false;
        }
        private void UpdatePictureSymbolControls(IPictureSymbol ps)
        {
            angleControl.Angle = -(int)ps.Angle;
            dbxOffsetX.Value = ps.Offset.X;
            dbxOffsetY.Value = ps.Offset.Y;
            sizeControl.Symbol = ps;

            sldImageOpacity.Value = ps.Opacity;
            txtImageFilename.Text = Path.GetFileName(ps.ImageFilename);

            chkUseOutlinePicture.Checked = ps.UseOutline;
            cbOutlineColorPicture.Color = ps.OutlineColor;
            sldOutlineOpacityPicture.Value = ps.OutlineOpacity;
            sldOutlineOpacityPicture.MaximumColor = Color.FromArgb(255, ps.OutlineColor);
            dbxOutlineWidth.Value = ps.OutlineWidth;
        }