public static void ZoomToFeature(IFeature pFeature, int bufferDistant)
{
IGeometry tGeometry = pFeature.Shape as IGeometry; //缓冲处理,使处于边界的元素在视图中能够完全显示
ITopologicalOperator mTopologicalOperator = (ITopologicalOperator)tGeometry;
IGeometry mPolygonBuffer = mTopologicalOperator.Buffer(bufferDistant) as IGeometry;
//MapControl.Extent = mPolygonBuffer.Envelope;
//MapControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, featureSelection, tGeometry.Envelope);
//ArcMap.Document.ActiveView.Extent = axMapControl1.ActiveView.Extent;
// ArcMap.Document.ActiveView.Refresh();
ArcMap.Document.ActiveView.Extent = mPolygonBuffer.Envelope;
ArcMap.Document.ActiveView.Refresh();
}
缩放到一个要素
最新推荐文章于 2022-04-23 20:57:41 发布