本文整理汇总了C#中IEnvelope.Expand方法的典型用法代码示例。如果您正苦于以下问题:C# IEnvelope.Expand方法的具体用法?C# IEnvelope.Expand怎么用?C# IEnvelope.Expand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEnvelope
的用法示例。
在下文中一共展示了IEnvelope.Expand方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetDynamicValues
//.........这里部分代码省略.........
for (int i = 0; i < sourceFieldNums.Length; i++)
{
int fnum = sourceLayer.FeatureClass.FindField(sourceFieldNames[i].Trim());
if (fnum < 0)
{
missingFieldMess = sourceFieldNames[i].Trim() + " in table " + sourceLayerName;
break;
}
sourceFieldNums[i] = fnum;
}
if (missingFieldMess == null)
{
for (int i = 0; i < destFieldNums.Length; i++)
{
int fnum = inFeature.Fields.FindField(destFieldNames[i].Trim());
if (fnum < 0)
{
missingFieldMess = destFieldNames[i].Trim() + " in table " + tableName;
break;
}
destFieldNums[i] = fnum;
}
}
if (missingFieldMess == null)
{
AAState.WriteLine(" Field Mapping verified");
// found source and destination fields.
sFilter = new SpatialFilterClass();
if (searchDistance > 0)
{
searchEnvelope = inFeature.ShapeCopy.Envelope;
searchEnvelope.Expand(searchDistance, searchDistance, false);
sFilter.Geometry = searchEnvelope;
}
else
sFilter.Geometry = inFeature.ShapeCopy;
sFilter.GeometryField = sourceLayer.FeatureClass.ShapeFieldName;
sFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;
AAState.WriteLine(" Searching for Nearest Feature");
fCursor = sourceLayer.FeatureClass.Search(sFilter, false);
sourceFeature = fCursor.NextFeature();
nearestFeature = null;
proxOp = (IProximityOperator)inFeature.Shape;
lastDistance = searchDistance;
if (sourceFeature != null)
{
AAState.WriteLine(" Features Found, looping for closest");
while (sourceFeature != null)
{
distance = proxOp.ReturnDistance(sourceFeature.Shape);
if (distance <= lastDistance)
{
nearestFeature = sourceFeature;
lastDistance = distance;
}
sourceFeature = fCursor.NextFeature();
}
}
if (nearestFeature != null)
示例2: ZoomTo
private void ZoomTo(IEnvelope extent)
{
if (extent.Height == 0)
extent.Height = extent.Width / 4;
if (extent.Width == 0)
extent.Width = extent.Height / 4;
extent.Expand(1.2, 1.2, true);
ArcMap.Document.ActivatedView.Extent = extent;
ArcMap.Document.ActivatedView.Refresh();
ArcMap.Document.ActivatedView.ScreenDisplay.UpdateWindow();
}
示例3: CenterBase
public void CenterBase(IEnvelope envelope)
{
IPoint point = new PointClass();
try
{
point.PutCoords((envelope.XMin + envelope.XMax) / 2, (envelope.YMin + envelope.YMax) / 2);
}
catch
{
envelope = axMapControl1.ActiveView.Extent;
point.PutCoords((envelope.XMin + envelope.XMax) / 2, (envelope.YMin + envelope.YMax) / 2);
}
//axMapControl1.CenterAt(point);
//居中方法二
envelope.Expand(this.Expand, this.Expand, true);
var env2 = axMapControl1.ActiveView.Extent;
env2.CenterAt(point);
axMapControl1.ActiveView.Extent = envelope;//env2 时 当前视图显示范围
axMapControl1.ActiveView.Refresh();
}