Click or drag to resize

IMcViewSetCenteredMagnification Method

Changes the Magnification while centering a given image point

Namespace:  MediaCy.IQL.Display.Viewer
Assembly:  MediaCy.IQL.Display.Viewer (in MediaCy.IQL.Display.Viewer.dll) Version: 10.0.6912.0
Syntax
VB
Sub SetCenteredMagnification ( 
	Optional newMag As Double = 0,
	<OptionalAttribute> ImagePtToCenter As Object
)

Parameters

newMag (Optional)
Type: SystemDouble
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)
Type: SystemObject
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.
Note Note
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.
See Also