ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Geometry Namespace / EnvelopeBuilderEx Class / Expand Method / Expand(Double,Double,Boolean) Method
Change in x
Change in y
If asRatio = true, the expansion is multiplicative. If false, the expansion is additive.
Example

In This Topic
    Expand(Double,Double,Boolean) Method
    In This Topic
    Moves the X and Y coordinates of the envelope sides toward or away from each other to scale the size of the envelope.
    Syntax
    public void Expand( 
       double dx,
       double dy,
       bool asRatio
    )
    Public Overloads Sub Expand( _
       ByVal dx As Double, _
       ByVal dy As Double, _
       ByVal asRatio As Boolean _
    ) 

    Parameters

    dx
    Change in x
    dy
    Change in y
    asRatio
    If asRatio = true, the expansion is multiplicative. If false, the expansion is additive.
    Remarks
    If asRatio = false, the expansion is additive. If you want to increase the envelope width by 5 units, then dx = 5. On the other hand, if you want to decrease the envelope width by 5 units, then dx = -5. Similarly, set dy to increase or decrease the envelope height.

    If asRatio = true, the expansion is multiplicative. If you want to increase the envelope width by 10%, then dx = 1.1. On the other hand, if you want to decrease the width by 10%, then dx = 0.9. Similarly, set dy to increase or decrease the envelope height. No negative numbers are allowed when asRatio is set to true.

    The Envelope remains centered at the same position.

    Example
    Expand an Envelope
    // Use a builderEx convenience method or use a builderEx constructor.
    
    // convenience methods don't need to run on the MCT.
    Envelope envelope = EnvelopeBuilderEx.CreateEnvelope(100.0, 100.0, 500.0, 500.0);
    
    // shrink the envelope by 50%
    Envelope result = envelope.Expand(0.5, 0.5, true);
    
    
    // builderEx constructors don't need to run on the MCT.
    EnvelopeBuilderEx builderEx = new EnvelopeBuilderEx(100.0, 100.0, 500.0, 500.0);
    builderEx.Expand(0.5, 0.5, true);
    envelope = builderEx.ToGeometry() as Envelope;
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also