Important: The information in this document is obsolete and should not be used for new development.
MapPt
To map a point in one rectangle to an equivalent position in another rectangle, use theMapPtprocedure.
PROCEDURE MapPt (VAR pt:\xDDPoint; srcRect,dstRect: Rect);
pt- Upon input, the point in the source rectangle to map; upon completion, its mapped position in the destination rectangle.
srcRect- The source rectangle containing the original point.
dstRect- The destination rectangle in which the point will be mapped.
DESCRIPTION
TheMapPtprocedure maps a point in one rectangle to an equivalent position in another rectangle.In the
ptparameter, you specify a point that lies within the rectangle that you specify in thesrcRectparameter. TheMapPtprocedure maps this point to a similarly located point within the rectangle that you specify in thedstRectparameter--that is, to where it would fall if it were part of a drawing being expanded or shrunk to fit the destination rectangle. TheMapPtprocedure returns the location of the mapped point in theptparameter. For example, a corner point of the source rectangle would be mapped to the corresponding corner point of the destination rectangle indstRect, and the center of the source rectangle would be mapped to the center of destination rectangle.The source and destination rectangles may overlap, and the point you specify need not actually lie within the source rectangle.
In Figure 3-23 on page 3-101, the point (3,2) in the source rectangle is mapped to (18,7) in the destination rectangle.
SEE ALSO
If you're going to draw inside the destination rectangle, you'll probably also want to scale the graphics pen size accordingly with theScalePtprocedure, described in the previous section.