예제 #1
0
        private void Btn_AddTitle_Click(object sender, EventArgs e)
        {
            ITextSymbol textSymbol = new TextSymbolClass();

            textSymbol.Color = Tool_.PutRGB(0, 0, 0);
            stdole.IFontDisp font = new stdole.StdFontClass() as stdole.IFontDisp;
            font.Bold       = true;
            font.Italic     = true;
            textSymbol.Font = font;
            textSymbol.Size = m_pEnvelopDrawed.Width * 20;
            IGraphicsContainer pGraphicsContainer = Ctrl_PageLayout.ActiveView.GraphicsContainer;
            ITextElement       pTextElement       = new TextElementClass
            {
                ScaleText = true,
                Symbol    = textSymbol,
                Text      = "Title"
            };

            if (m_pTitleElement != null)
            {
                pGraphicsContainer.DeleteElement(m_pTitleElement);
            }
            IElement pElement  = pTextElement as IElement;
            IPoint   pPosition = new PointClass();

            pPosition.PutCoords(
                m_pEnvelopDrawed.XMin + (m_pEnvelopDrawed.XMax - m_pEnvelopDrawed.XMin) / 2,
                m_pEnvelopDrawed.YMin + (m_pEnvelopDrawed.YMax - m_pEnvelopDrawed.YMin) / 2);
            pElement.Geometry = pPosition;
            pGraphicsContainer.AddElement(pElement, 0);
            m_pTitleElement = pElement;
            Ctrl_PageLayout.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
        }
예제 #2
0
        private void Btn_ApplySpatialFilter_Click(object sender, EventArgs e)
        {
            ISpatialFilter pSpatialFilter = new SpatialFilter
            {
                SpatialRel = (esriSpatialRelEnum)CbBox_Mode.SelectedIndex,
                Geometry   = Tool_.GetShapeUnion(pSelectedSourceFeaturelayer, Convert.ToDouble(TxtBox_BufferSize.Text))
            };
            IFeatureSelection pFeatureSelection = pSelectedFeatureLayer as IFeatureSelection;

            pFeatureSelection.SelectFeatures(pSpatialFilter, (esriSelectionResultEnum)CbBox_SelectionSetOperationType.SelectedIndex, false);
            (m_pCurMap as IActiveView).Refresh();
            m_FrmMainOper(OperationType.FormAttributeHighLightRow);
        }
예제 #3
0
 public FormSymbology(FormMainOperation frmMainOperation)
 {
     InitializeComponent();
     frmMainOper = frmMainOperation;
     m_pTarLayer = frmMainOper(OperationType.GetSelectedLayer) as ILayer;
     m_pTarMap   = frmMainOper(OperationType.GetMap) as IMap;
     m_pTarScene = frmMainOper(OperationType.GetScene) as IScene;
     if (m_pTarLayer is IRasterLayer)
     {
         ILayer pCurLayer;
         for (int i = 0; i < m_pTarScene.LayerCount; i++)
         {
             pCurLayer = m_pTarScene.Layer[i];
             if (pCurLayer is IRasterLayer)
             {
                 CbBoxBaseLayer.Items.Add(pCurLayer.Name);
             }
         }
         if (CbBoxBaseLayer.Items.Count != 0)
         {
             CbBoxBaseLayer.SelectedIndex = 0;
         }
     }
     else
     {
         m_pFillColor    = Tool_.PutRGB(255, 255, 255);
         m_pOutlineColor = Tool_.PutRGB(255, 255, 255);
         #region 获取图层所有的字段,放入comboBox
         for (int i = 0; i < m_pTarFeatureLayer.FeatureClass.Fields.FieldCount; i++)
         {
             string fieldName = m_pTarFeatureLayer.FeatureClass.Fields.get_Field(i).Name;
             if (fieldName.ToUpper() != "SHAPE" && fieldName.ToUpper() != "FID")
             {
                 comboBox1.Items.Add(m_pTarFeatureLayer.FeatureClass.Fields.get_Field(i).Name);
             }
         }
         if (comboBox1.Items.Count != 0)
         {
             comboBox1.SelectedIndex = 0;
         }
         #endregion
     }
     if ((int)frmMainOper(OperationType.GetViewIndex) == 2)
     {
         Ctrl_Tab.TabPages[0].Dispose();
     }
     else
     {
         Ctrl_Tab.TabPages[1].Dispose();
     }
 }
예제 #4
0
        private void button6_Click(object sender, EventArgs e)
        {
            Dictionary <string, IRgbColor> temp = new Dictionary <string, IRgbColor>();

            temp.Add(m_pTarFeatureLayer.FeatureClass.Fields.get_Field(m_pTarFeatureLayer.FeatureClass.FindField(comboBox1.SelectedItem.ToString())).Name, Tool_.PutRGB(150, 150, 0));
            ChartRenderer(m_pTarFeatureLayer, temp);
        }
예제 #5
0
 private void button3_Click(object sender, EventArgs e)
 {
     colorDialog1.ShowDialog();
     m_pOutlineColor   = Tool_.PutRGB(colorDialog1.Color.R, colorDialog1.Color.G, colorDialog1.Color.B);
     button3.BackColor = colorDialog1.Color;
 }