Envelope env = EnvelopeBuilder.CreateEnvelope(100.0, 100.0, 500.0, 500.0);
// env.HasZ = false
Envelope result = GeometryEngine.Instance.Expand(env, 0.5, 0.5, true);
// result.Center = 300, 300
// result.XMin = 200
// result.YMin = 200
// result.XMax = 400
// result.YMax = 400
result = GeometryEngine.Instance.Expand(env, 100, 200, false);
// result.Center = 300, 300
// result.XMin = 0
// result.YMin = -100
// result.XMax = 600
// result.YMax = 700
try
{
// expand in 3 dimensions
result = GeometryEngine.Instance.Expand(env, 0.5, 0.5, 0.5, true);
}
catch (InvalidOperationException e)
{
// the geometry is not Z-Aware
}
// expand a 3d envelope
MapPoint pt1 = MapPointBuilder.CreateMapPoint(100, 100, 100);
MapPoint pt2 = MapPointBuilder.CreateMapPoint(200, 200, 200);
env = EnvelopeBuilder.CreateEnvelope(pt1, pt2);
// env.HasZ = true
result = GeometryEngine.Instance.Expand(env, 0.5, 0.5, 0.5, true);
// result.Center = 150, 150, 150
// result.XMin = 125
// result.YMin = 125
// result.ZMin = 125
// result.XMax = 175
// result.YMax = 175
// result.ZMax = 175