Important: The information in this document is obsolete and should not be used for new development.
ScaleMapping
You can usethe
ScaleMapping
function to change the horizontal and vertical scale factors of a mapping.
gxMapping *ScaleMapping(gxMapping *target, Fixed hFactor, Fixed vFactor, Fixed xCenter, Fixed yCenter);
- target
- A pointer to the mapping that is to be modified. On return, points to the modified mapping.
hFactor
- The horizontal scaling factor to apply. A value of 1.0 means no scale change in the x direction.
- vFactor
- The vertical scaling factor to apply. A value of 1.0 means no scale change in the y direction.
xCenter
- The x-coordinate of the center of scaling.
yCenter
- The y-coordinate of the center of scaling.
- function result
- A pointer to the modified mapping, which is also the target mapping.
DESCRIPTION
TheScaleMapping
function postmultiplies the target mapping by a mapping that specifies a horizontal scaling factor ofhFactor
and a vertical scaling factor ofvFactor
, about the point (xCenter
,yCenter
). Note that ifhFactor
is 1,xCenter
irrelevant; likewise, if vFactor is 1,yCenter
is irrelevant.These scaling factors are in addition to any preexisting scaling factors in the target mapping. The center of scaling is the point that does not move when the scaling is applied.
Passing the result of the
ScaleMapping
function to theGXMapShape
function is equivalent to calling theGXMapShape
function and then calling theGXScaleShape
function. For example, you could make these calls (for the shapes
):
ScaleMapping(target, hFactor, vFactor, xCenter, yCenter); GXMapShape(s, target);or, you could make these equivalent calls:
GXMapShape(s, target); GXScaleShape(s, hFactor, vFactor, xCenter, yCenter);ERRORS, WARNINGS, AND NOTICES
Errors mapping_is_nil SEE ALSO
The use of theScaleMapping
function is described in the section "Scaling" beginning on page 8-20.The
GXMapShape
andGXScaleShape
functions are described in the chapter "Transform Objects" in Inside Macintosh: QuickDraw GX Objects.