ArcGIS Enterprise SDK

ITransform2D.Scale Method

Scales about the specified origin using seperate horizonal and vertical scales. The origin point can be in a different spatial reference than the geometry being scaled.

[Visual Basic .NET]Public Sub Scale ( _ByValOriginAsIPoint, _ByValsxAsDouble, _ByValsyAsDouble _)

[C#]publicvoidScale (IPointOrigin,doublesx,doublesy);

Stretches the Geometry a factor of sX along the X-Axis and a factor of sY along the Y-Axis (where sX is the ratio of Old Width to New Width, and sY is the ratio of Old Height to New Height). The Origin point is the reference Point from which the transformation is performed (Regardless of the location of the Origin point, the Geometry resulting from the transformation is the same, except for a positional offset). The Origin is the only point in the transformation guaranted to remain in the same location after the transformation is complete.

Note: Caution must be taken when scaling a CircularArc or a geometry containing CircularArc segments. Unless Abs(ScaleX) = Abs(ScaleY), the resulting CircularArcs will not retain the characteristics of the original geometry (since they remain CircularArcs).

[C#]

//Create Point you wish to scale

IPoint startingPoint = new PointClass() as IPoint;

startingPoint.PutCoords(10, 10);

//Create a point to act as origin

IPoint origin = new PointClass() as IPoint;

origin.PutCoords(15, 15);

//Cast the startingPoint into the correct Interface

ITransform2D transformScalePoint = startingPoint as ITransform2D;

//Perform Scale

transformScalePoint.Scale(origin, .5, .5);

double x;

double y;

startingPoint.QueryCoords(out x, out y);

Debug.Print(x.ToString());

Debug.Print(y.ToString());