Ejemplo n.º 1
0
        public InsertTextForm()
        {
            InitializeComponent();
            ////变量初始化
            //_textAngle = 0;
            //_textColor = ColorImp.GetRGBColor(Color.Red.R, Color.Red.G, Color.Red.B) as IColor;
            //_textFont = new stdole.StdFontClass() as stdole.IFontDisp;
            //_textFont.Name = FontType.宋体.ToString();
            //_textSize = 20;

            ////控件初始化
            //txbxInsertText.Text = "未知文本";
            //txbxInsertText.SelectAll();
            //cmbxFont.DataSource = System.Enum.GetNames(typeof(FontType));
            //cmbxFont.SelectedIndex = 0;
            //cmbxSize.DataSource = _sizeArr;
            //cmbxSize.SelectedIndex = this.cmbxSize.FindString("20");
            //btnColor.BackColor = Color.Red;

            IColor    textColor = ElementPropetyImp.GetRGBColor(0, 0, 0) as IColor;
            IFontDisp textFont  = new stdole.StdFontClass() as stdole.IFontDisp;

            textFont.Name = FontType.宋体.ToString();
            InitVariablesAndControls(0, textColor, textFont, 20, "未知文本");
        }
Ejemplo n.º 2
0
        private void btnApply_Click(object sender, EventArgs e)
        {
            IScaleBar mapScaleBar = (m_styleGalleryItem.Item as IScaleBar);

            if (mapScaleBar == null)
            {
                return;
            }

            //设置单位
            int unitIndex = cmbxUnit.SelectedIndex;

            mapScaleBar.Units = (esriUnits)unitIndex;

            //设置文本字体、大小与颜色
            ITextSymbol textSymbol = mapScaleBar.LabelSymbol;

            textSymbol.Font.Name = cmbxTextFont.Text;
            textSymbol.Size      = Convert.ToDouble(cmbxTextSize.Text);
            textSymbol.Color     = ElementPropetyImp.GetRGBColor(btnTextColor.BackColor.R, btnTextColor.BackColor.G, btnTextColor.BackColor.B) as IColor;

            mapScaleBar.LabelSymbol = textSymbol;

            //设置条块大小与颜色
            mapScaleBar.BarHeight = Convert.ToDouble(cmbxSymbolSize.Text);
            mapScaleBar.BarColor  = ElementPropetyImp.GetRGBColor(btnSymbolColor.BackColor.R, btnSymbolColor.BackColor.G, btnSymbolColor.BackColor.B) as IColor;

            PreviewImage();
        }
Ejemplo n.º 3
0
        private void btnFillColor_Click(object sender, EventArgs e)
        {
            ColorDialog  colorDialog = new ColorDialog();
            DialogResult result      = colorDialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                btnFillColor.BackColor = colorDialog.Color;

                IMapSurround pMapSurround = m_styleGalleryItem.Item as IMapSurround;
                if (pMapSurround == null)
                {
                    return;
                }

                if (pMapSurround is IMarkerNorthArrow)
                {
                    IMarkerSymbol markerSymbol = (pMapSurround as IMarkerNorthArrow).MarkerSymbol;
                    markerSymbol.Color = ElementPropetyImp.GetRGBColor(colorDialog.Color.R, colorDialog.Color.G, colorDialog.Color.B);
                    (pMapSurround as IMarkerNorthArrow).MarkerSymbol = markerSymbol;
                }
                else
                {
                    return;
                }

                PreviewImage();
            }
        }
Ejemplo n.º 4
0
        private void btnColor_Click(object sender, EventArgs e)
        {
            ColorDialog  colorDialog = new ColorDialog();
            DialogResult result      = colorDialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                btnColor.BackColor = colorDialog.Color;
                _textColor         = ElementPropetyImp.GetRGBColor(btnColor.BackColor.R, btnColor.BackColor.G, btnColor.BackColor.B) as IColor;
            }
        }