﻿ Expand Method—ArcGIS Pro
ArcGIS Pro 2.6 API Reference Guide
Expand Method (Envelope)
Example

 ArcGIS.Core.Geometry Namespace > Envelope Class : Expand Method
Scale X factor. Factor must be 0 or greater. Values greater than 1 creates a larger envelope, and less then 1 shrinks it.
Scale Y factor. Factor must be 0 or greater. Values greater than 1 creates a larger envelope, and less then 1 shrinks it.
If asRatio = TRUE, the expansion is multiplicative. If FALSE, the expansion is additive.
Creates a new envelope expanded by the amount specified. Expand moves the X and Y coordinates of the sides toward or away from each other to scale the size of the Envelope.
Syntax
```public Envelope Expand(
double sx,
double sy,
bool asRatio
)```
```Public Function Expand( _
ByVal sx As Double, _
ByVal sy As Double, _
ByVal asRatio As Boolean _
) As Envelope```

#### Parameters

sx
Scale X factor. Factor must be 0 or greater. Values greater than 1 creates a larger envelope, and less then 1 shrinks it.
sy
Scale Y factor. Factor must be 0 or greater. Values greater than 1 creates a larger envelope, and less then 1 shrinks it.
asRatio
If asRatio = TRUE, the expansion is multiplicative. If FALSE, the expansion is additive.

#### Return Value

Expanded envelope
Remarks
If asRatio = FALSE, the expansion is additive.
XMin = XMin - sx
YMin = YMin - sy
XMax = XMax + sx
YMax = YMax + sy

If asRatio = TRUE, the expansion is multiplicative. If the user wants to increase the envelope width by 10%, then dx = 1.1. On the other hand, if the user intends to decrease the width by 10%, then dx = 0.9. No negative number allowed when asRatio is set to TRUE.
XMin = XMin - (sx-1)*Width/2
YMin = YMin - (sy-1)*Height/2
XMax = XMax + (sx-1)*Width/2
YMax = YMax + (sy-1)*Height/2
The Envelope remains centered at the same position.

Example
Example: Expand the envelope by 10%
`Envelope expanded = myEnvelope.Expand(1.1,1.1,true);`
```// Use a builder convenience method or use a builder constructor.

// Builder convenience methods don't need to run on the MCT.
Envelope envelope = EnvelopeBuilder.CreateEnvelope(100.0, 100.0, 500.0, 500.0);

// shrink the envelope by 50%
Envelope result = envelope.Expand(0.5, 0.5, true);

// Builder constructors need to run on the MCT.
{
using (EnvelopeBuilder eBuilder = new EnvelopeBuilder(100.0, 100.0, 500.0, 500.0))
{
// shrink by 50%
eBuilder.Expand(0.5, 0.5, true);

result = eBuilder.ToGeometry();
}
});
```
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 7