ImageGear for C and C++ on Windows v19.5 - Updated
Thumbnail Window
User Guide > How to Work with... > Common Operations > Viewing > GUI Features > GUI Windows > Thumbnail Window

A GUI thumbnail window is a window in which thumbnails (miniature images) are displayed. ImageGear's thumbnail window support functions include the ability to do the following:

Creating a thumbnail window is just like creating any other GUI window. You call IG_GUI_thumbnail_window_create_ex() and specify the dimensions and position for the new thumbnail window.

Having done this, you can have ImageGear add thumbnails to the window by calling either IG_GUI_thumbnail_file_append(), to add a thumbnail image of a single file, or IG_GUI_thumbnail_dir_append(), to add from a directory a group of thumbnails matching a "filter" or "wildcard" string such as "*.BMP;*.JPG."

You can also drag files from Windows Explorer into the GUI thumbnail window.

When you add a thumbnail of a multi-page file, only a thumbnail of the first page of the file is displayed, unless you use IG_GUI_thumbnail_attribute_set() to show all of the pages. If only the first page is displayed, the filename that appears under the thumbnail is accompanied by an asterisk.

There are a number of attributes that affect the way the thumbnails themselves are displayed. These are all modifiable using the function IG_GUI_thumbnail_attribute_set().

To learn when a user has clicked the mouse on a thumbnail, and which thumbnail it was, use IG_GUI_thumbnail_CB_register() to register a callback function of type LPFNIG_GUITHUMBSELECT. Your callback function is called with a far pointer to the filename string that corresponds to the thumbnail image, and a pointer to the thumbnail image's DIB header.

You can have ImageGear sort thumbnails that are currently being displayed in the thumbnail window. Call IG_GUI_thumbnail_sort(), providing the address of a callback function of type LPFNIG_GUITHUMBCOMP. This callback function will then be called successively for each pair of thumbnails, with pointers to both filenames and both DIB headers. Your LPFNIG_GUITHUMBCOMP function can compare the two according to any scheme you choose, returning -1, 0, or +1 to tell ImageGear that the first of the pair should be placed before, equal to, or after the second, respectively. ImageGear will keep calling this function with pairs until all the thumbnails are sorted (ImageGear automatically adjusts their positions in the thumbnail window.).

Call function IG_GUI_thumbnail_update() if something being displayed in the thumbnail window has changed in memory and you want ImageGear to refresh the thumbnail window display.

Refer to the Core Component API Function Reference for descriptions of the IG_GUI_ ...() functions and the LPFNIG_GUI... callback types as well as for the calling sequences of ImageGear's Graphical User Interface support functions.