Using the Zoom View
(Document and Medical Imaging toolkits)
LEADTOOLS provides a "zoomed view" that can be attached to a window handle. This Zoom View provides a means of "zooming in" on the image loaded into the window to which it is attached. This is similar to having multiple Magnifying Glasses on the same source image.
Use the "Zoom View" if you want to:
Display one or more zoomed views for a single displayed image
Display an annotation in addition to the zoomed view
display callout lines
Note that LEADTOOLS also provides a "magnifying glass" that can be attached to a window handle.
Use the "Magnifying Glass" if you want to:
Work with the magnifying glass after passing a callback function to the L_StartMagGlass function; the optional callback is used to handle the WM_LBUTTONDOWN, WM_LBUTTONUP and WM_MOUSEMOVE messages received by the window to which the Magnifying Glass is attached.
Set the contrast, gamma and intensity for the zoomed area.
For more information about the magnifying glass, refer to Using the Magnifying Glass.
To attach the zoomed view to a window, call the L_CreateZoomView function. To determine whether a window has a zoomed view attached to it, call the L_WindowHasZoomView function. As the source rectangle is moved over an image, the zoomed - in view also changes.
The following can be set using the ZOOMVIEWPROPS structure:
The rectangle describing the source area of the image to be zoomed
The rectangle describing the location of the zoomed view
The zoom factor
Whether the zoomed view should be the size of the rectangle describing the location of the zoomed view, or whether to display the source rectangle magnified by the specified zoom factor
The border style for the zoomed view, along with border color and pen style
The border style for the source rectangle, along with border color and pen style
Whether callout lines will be used, along with color and pen style
The annotation object to be displayed
Use the L_GetZoomViewProps function to obtain the properties for the specified zoom view.
To change the current options for the specified Zoom View, change the values in the structure pointed to by pZoomViewProps and pass a pointer to the updated structure to L_UpdateZoomView.
To update the Zoom View procedure with a new destination rectangle, call the L_UpdateZoomView function. This should be done anytime the image’s destination rectangle is modified, for example, when scrolling or zooming. This should also be done anytime the source image is changed, for example resized, flipped, etc.
The L_CreateZoomView function lets you set all of the previously listed properties.
Use the L_RenderZoomView function to display the Zoom Views that are attached to the specified window in the specified device context.
LEADTOOLS provides several different shapes for the zoomed view, including a rectangle, a rounded rectangle and a shape that looks like a piece of paper that has been torn from a larger sheet.
When the zoomed view is no longer needed, call L_DestroyZoomView to stop the Zoom View procedure and to detach it from the window handle.
The “zoomed view” can be used together with annotations to create a powerful effect. Annotations can be created,edited, or deleted directly on the original image, or within the zoom view objects themselves.
All annotation edits are instantly displayed in all zoom view objects, even if they are overlapping.
To use zoom view with annotations, call the L_StartZoomViewAnnEdit function to display any annotation in edit mode or design mode. To end the annotation edit mode (or to display the annotations in run-mode), call the function L_StopZoomViewAnnEdit.
For information on using a zoom view with annotations, see the ZOOMVIEWPROPS.