当前位置: 首页>>代码示例>>C#>>正文


C# IActiveView.Refresh方法代码示例

本文整理汇总了C#中IActiveView.Refresh方法的典型用法代码示例。如果您正苦于以下问题:C# IActiveView.Refresh方法的具体用法?C# IActiveView.Refresh怎么用?C# IActiveView.Refresh使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IActiveView的用法示例。


在下文中一共展示了IActiveView.Refresh方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: drawPolygon

 //
 //
 //
 public static void drawPolygon(IActiveView pActiveView)
 {
     IGraphicsContainer iGC = pActiveView as IGraphicsContainer;
     IRubberBand pRubberPoly = new RubberPolygonClass();
     IScreenDisplay pScreenDisp = pActiveView.ScreenDisplay;
     IGeometry pGeom;
     pGeom = pRubberPoly.TrackNew(pScreenDisp, null);
     IPolygon pPoly = pGeom as IPolygon;
     IElement pEle;
     if (pPoly != null)
     {
         pEle = new PolygonElementClass() as IElement;
         pEle.Geometry = pPoly;
         iGC.AddElement(pEle, 0);
     }
     pActiveView.Refresh();
 }
开发者ID:lovelll,项目名称:MyDatapreMenu,代码行数:20,代码来源:UtilityFunction.cs

示例2: btnOpnMap_Click

        private void btnOpnMap_Click(object sender, EventArgs e)
        {
            double dobX, dobY;
            string txtCoodX, txtCoodY;
            if (lstVwCood.Items.Count < 3)
            {
                MessageBox.Show("请输入三个以上的点!");
                return;
            }
            else
            {
                for (int i = 0; i < lstVwCood.Items.Count; i++)
                {
                    txtCoodX = lstVwCood.Items[i].SubItems[1].Text;
                    txtCoodY = lstVwCood.Items[i].SubItems[2].Text;
                    dobX = Convert.ToDouble(txtCoodX);
                    dobY = Convert.ToDouble(txtCoodY);
                    pPnt.PutCoords(dobX, dobY);
                    if (pNPolFeback == null)
                    {
                        pNPolFeback = new NewPolygonFeedbackClass();
                        ISimpleLineSymbol pSLnSym;
                        IRgbColor pRGB = new RgbColorClass();
                        pSLnSym = (ISimpleLineSymbol)pNPolFeback.Symbol;
                        pRGB.Red = 140;
                        pRGB.Green = 140;
                        pRGB.Blue = 255;
                        pSLnSym.Color = pRGB;
                        pSLnSym.Style = esriSimpleLineStyle.esriSLSSolid;
                        pSLnSym.Width = 2;
                        pNPolFeback.Display = pScreen;
                        pNPolFeback.Start(pPnt);
                    }
                    else
                    {
                        pNPolFeback.AddPoint(pPnt);
                    }
                }
                pActivew = pMapControl.ActiveView;
                pScreen = pActivew.ScreenDisplay;
                IGeometry pGeomLn;
                pGeomLn = (IGeometry)pNPolFeback.Stop();
                IMap pMap = pMapControl.Map;

                ISpatialReference spatialReference = pMap.SpatialReference;
                pGeomLn.SpatialReference = spatialReference;
                IBorder pBorder = new SymbolBorderClass();
                LayerControl.LyrPolygon = pGeomLn;
                pMapControl.Map.ClipBorder = pBorder;
                pMapControl.Map.ClipGeometry = pGeomLn;
                pActivew.Extent = pGeomLn.Envelope;
                //pActivew.Refresh();
                this.DialogResult = DialogResult.OK;
                ////打开地形图图层

                 //layVisbleExceptMap();
                this.Close();
                pActivew.Refresh();
            }
        }
开发者ID:chinasio,项目名称:minegis,代码行数:60,代码来源:frmOpenMapByCoordinate.cs

示例3: PanToGeometries

 public static void PanToGeometries(IList<IGeometry> geometries, IActiveView activeView)
 {
     if (geometries != null && activeView != null)
     {
         IEnvelope envelope = GetExtentFromGeometries(geometries);
         IDisplayTransformation displayTransformation = activeView.ScreenDisplay.DisplayTransformation;
         if (DisplayMap.IsGeometryValid(envelope as IGeometry))
         {
             if (envelope.SpatialReference == null || envelope.SpatialReference.Equals(activeView.FocusMap.SpatialReference) == false)
                 envelope.Project(activeView.FocusMap.SpatialReference);
             displayTransformation.VisibleBounds = envelope;
             activeView.Refresh();
         }
     }
 }
开发者ID:Ramakrishnapv,项目名称:FuturaNetwork,代码行数:15,代码来源:DisplayMap.cs

示例4: CenterOnEnvelope

        /// <summary>
        /// Centers the active view on the extent of the given geometry.
        /// </summary>
        /// <param name="activeView">The active view.</param>
        /// <param name="geom">The geometry on which to center the active view.</param>
        /// <param name="mapScale">The mapscale to apply to the map.</param>
        private static void CenterOnEnvelope(IActiveView activeView, IGeometry geom, double mapScale)
        {
            if (activeView != null && geom != null)
            {
                if (geom.IsEmpty == false)
                {
                    if (geom.SpatialReference.Equals(activeView.FocusMap.SpatialReference) == false)
                        geom.Project(activeView.FocusMap.SpatialReference);
                    IEnvelope env = new EnvelopeClass();
                    env = geom.Envelope;
                    if (env.Width == 0 || env.Height == 0)
                    {
                        IEnvelope activeViewEnvelope = activeView.Extent;
                        activeViewEnvelope.CenterAt(env.LowerLeft);
                        activeView.Extent = activeViewEnvelope;
                        if (mapScale == 0)
                            mapScale = 2000;
                    }
                    else
                        activeView.Extent = env;

                    if (mapScale > 0)
                        activeView.FocusMap.MapScale = mapScale;

                    activeView.Refresh();
                }
            }
        }
开发者ID:Ramakrishnapv,项目名称:FuturaNetwork,代码行数:34,代码来源:DisplayMap.cs

示例5: SelecionarFeature

        /// <summary>
        /// Seleciona uma feature no Mapa
        /// </summary>
        /// <param name="feature">Feature que deve ser selecionada</param>        
        ///<param name="activeView">Visão de mapa em uso</param>
        public static void SelecionarFeature(IFeature feature, IActiveView activeView)
        {
            LimparSelecoes(activeView);

            esriFeatureType featType = ((IFeatureClass)feature.Table).FeatureType;
            if (featType == esriFeatureType.esriFTSimpleJunction | featType == esriFeatureType.esriFTSimpleEdge | featType == esriFeatureType.esriFTSimple | featType == esriFeatureType.esriFTComplexEdge)
            {
                IDataset ds = feature.Table as IDataset;
                string[] className = ds.Name.Split('.');

                IFeatureLayer flayer = GetFeatureLayer(className[1], activeView);

                if (flayer != null)
                {
                    if (className.Length > 1)
                    {
                        activeView.FocusMap.SelectFeature(flayer, feature);
                    }
                    else
                    {
                        activeView.FocusMap.SelectFeature(flayer, feature);
                    }
                    activeView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, null);

                    if (feature.Shape.GeometryType == esriGeometryType.esriGeometryPoint)
                    {
                        IEnvelope env = activeView.Extent.Envelope;
                        env.CenterAt(feature.Shape as IPoint);
                        activeView.Extent = env;
                    }
                }

                activeView.Refresh();
            }
        }
开发者ID:ezequias,项目名称:Esri,代码行数:40,代码来源:GisUtils.cs


注:本文中的IActiveView.Refresh方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。