ArcGIS Explorer Component Help |
GeometryOperations..::.Scale Method (Geometry, Double) |
GeometryOperations Class Example See Also |
Returns a new Geometry which is a copy of the input Geometry scaled by the specified amount along both the x and y axis,
.
Namespace:
ESRI.ArcGISExplorer.GeometryAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public static Geometry Scale( Geometry inputGeometry, double scale ) |
Visual Basic (Declaration) |
---|
Public Shared Function Scale ( _ inputGeometry As Geometry, _ scale As Double _ ) As Geometry |
Parameters
- inputGeometry
- Type: ESRI.ArcGISExplorer.Geometry..::.Geometry
The Geometry to copy and scale.
- scale
- Type: System..::.Double
The factor by which to scale the geometry.
Return Value
A new Geometry of the same type as the inputGeometry, scaled by the scale factor.Remarks
The point of origin used for the operation is the center of the extent of the geometry; both the minimum and maximum X and Y coordinates of the geometry will change equally.
You can use this overload of the Scale method to resize a geometry and maintain the original aspect ratio; the geometry is stretched equally along both the x and y axis. Other overloads allow you to scale a geometry and change the aspect ratio.
Examples
The code below gets the Note currently selected, and uses the GeometryOperations class to
scale the Geometry of the Graphic of the Note by a factor of 2 around its center point.
The code assumes you have using statements for the Application, Geometry and Mapping namespaces.
CopyC#
SelectedItemsCollection selItems = ESRI.ArcGISExplorer.Application.Application.SelectedItems; if ((selItems.Count == 1) && (selItems[0] is Note)) { Note selected = selItems[0] as Note; // Scale the geometry Geometry scaled = GeometryOperations.Scale(selected.Graphic.Geometry, 2); // Update the geometry of the graphic. selected.Graphic.Geometry = scaled; }
CopyVB.NET
Dim selItems As SelectedItemsCollection = ESRI.ArcGISExplorer.Application.Application.SelectedItems If selItems.Count = 1 AndAlso TypeOf selItems(0) Is Note Then Dim selected As Note = selItems(0) ' Scale the geometry Dim scaled As Geometry = GeometryOperations.Scale(selected.Graphic.Geometry, 2) ' Update the geometry of the graphic. selected.Graphic.Geometry = scaled End If