User Guide > How to Work with... > Common Operations > Viewing > GUI Features > GUI Windows > Pan Window |
To create a GUI pan window, invoke IG_GUI_pan_window_create_ex(). This function creates a new window on your screen in which the HIGEAR image you name in the call will be displayed in its entirety. In this call you also name a second window, called the parent window.
As the user of your application moves the mouse around in the pan window, you can have ImageGear pan (slide) the image in the parent window, such that you see (in the parent window) the portion of the image selected by the mouse's position in the pan window. Here is how to do it:
ImageGear does not currently support tracking of the right mouse button, only the left. |
Your IG_GUI_pan_track_mouse() call causes ImageGear to automatically reposition the image in the parent window.
If your parent window is not a GUI image window (that is, if you did not call IG_GUI_window_associate() or IG_GUI_window_create() for this window), then your IG_GUI_pan_track_mouse() call generates Windows WM_PAINT and WM_... scroll messages that can be used to slide the image in the parent window. However, ImageGear does not intercept these messages and handle them automatically. Your application must detect the messages and execute calls to cause the scrolling or other effects you want. |
When your application uses a pan window, you can use the Windows call DestroyWindow() to remove it. You can disassociate the parent window from GUI by calling IG_GUI_window_associate() with BOOL argument bAssociate = FALSE. If you call function IG_GUI_window_CB_register(), whenever a GUI image window is destroyed, your LPFNIG_GUIWINDESTROY callback function is called.
An additional GUI pan function, IG_GUI_pan_update(), is provided so that you can tell ImageGear to update (refresh) the pan window if the HIGEAR image that is being displayed in it has changed in memory.