ImageGear for C and C++ on Windows v19.7 - Updated
IG_GUI_magnify_track_mouse
API Reference Guide > Core Component API Reference > Core Component Functions Reference > GUI Functions > GUI Magnify Functions > IG_GUI_magnify_track_mouse

This function can be called while processing the Windows mouse-button-down message WM_LBUTTONDOWN, for a magnify window's parent window.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_GUI_magnify_track_mouse ( 
        HIGEAR hIGear, 
        DWORD dwGrpID, 
        HWND hWndMagnify, 
        INT nX, 
        INT nY 
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of image.
DwGrpID DWORD Identifier of group which is used for drawing the image in the parent window.
HwndMagnify HWND Handle of GUI Magnify window.
nX INT X position of left mouse button click.
nY INT Y position of left mouse button click.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.

Sample:

Magnify, Display, GUI Windows

Example:

 
Copy Code
HIGEAR   hIGear;     /* Global handle of image in parent window  */
HWND    hWndParent;  /* Global Windows handle of that window  */
HWND    hWndMagnify;  /* Global HIGEAR handle of Magnify window */
AT_ERRCOUNT nErrcount; /* Returned count of errors  */
 ...
/* Create a Magnify window for the image in window hWndParent: */
nErrcount = IG_GUI_magnify_window_create ( hIGear, IG_GRP_DEFAULT, hWndParent, "I.G. Mag
Window", 50, 50, 200, 200, &hWndMagnify );
 ...
/* Message-Handling routine: */
LPARAM CALLBACK  MsgHandler (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
{
 ...
switch (msg)
        {
        case WM_LBUTTONDOWN:
 /* if occurred in the Magnify window: */
                IG_GUI_magnify_track_mouse ( hIGear, IG_GRP_DEFAULT, hWndMagnify, LOWORD(lParam),
HIWORD(lParam) );
                /* The above will display magnified, the location where the mouse was just clicked
in the parent image window. */
 ...
        }
 ...
}
/* See also sample application MAGNIFY. */

Remarks:

This function will show, magnified in the magnify window, the portion of the image that is at the location of the mouse click in the parent window.

See the function IG_GUI_magnify_window_create().

You can obtain the coordinates (nX, nY) of the mouse click, from the parameters passed by Windows with the WM_... message. See the sample application MAGNIFY for a description of how to use this and related IG_GUI_magnify_...() functions.

You cannot use IG_GUI_..._track_mouse() with a WM_RBUTTONDOWN message. ImageGear only responds to left mouse button clicks.