Parameters
- dx
- Change in x
- dy
- Change in y
- asRatio
- If asRatio = TRUE, the expansion is multiplicative. If FALSE, the expansion is additive.
Exception | Description |
---|---|
ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
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 - (dx-1)*Width/2
YMin = YMin - (dy-1)*Height/2
XMax = XMax + (dx-1)*Width/2
YMax = YMax + (dy-1)*Height/2
The Envelope remains centered at the same position.
// 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. ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { 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(); } });
Target Platforms: Windows 10, Windows 8.1, Windows 7