Description
Changes the Magnification while centering a given image point
-
Return Type
-
None
-
Syntax
-
object.SetCenteredMagnification [newMag], [ImagePtToCenter]
The SetCenteredMagnification Method syntax has these parts: |
| object | An expression evaluating to an object of type McView. | | newMag | Optional. A Double value. double : If greater than 0, the new Magnification property to set. If 0 (the default), the Magnification property is kept the same, but the Pan and Scroll properties are adjusted to center the point given by the ImagePtToCenter argument.
| | ImagePtToCenter | Optional. A Variant value. VARIANT : Either a scalar value from the mcImagePtToCenter enumeration. Or a length 2 numeric array (or SINGLEPOINT or LONGPOINT) giving the X,Y point to be centered, in image coordinates (you can convert from client to image coodinates with the MapZoomedToImage method). The enumeration allows you to specify either the center of the client area (mciptcCenterOfView) or the current mouse cursor position (mciptcUnderMouse). By default, the center of the client area is used.
| Remarks
When the Magnification property is changed, you quite often also want to adjust the Pan and Scroll properties so that a particular image point remains centered in the view. This method performs that job for you.
Notes
It may not be possible to center the specified point due to the constraint that neither Pan nor Scroll may be negative or so great as to allow the image to slide out of the window. In these cases, Pan and Scroll are clipped to their extreme values so as to move the desired point as close to the center of the view as possible.
If the ImagePtToCenter is given as a scalar value of mciptcUnderMouse, then the mouse cursor is moved to track the new position of the original image point under the mouse.
|