ImageGear for C and C++ on Windows v20.5 - Updated
IG_GUI_page_insert
API Reference Guide > Core Component API Reference > Core Component Functions Reference > GUI Functions > GUI Page Functions > IG_GUI_page_insert

This function inserts a new image into the GUI Page Sorter window referenced by hwndPage.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_GUI_page_insert(
        HWND hwndPage, 
        HIGEAR hIGear, 
        UINT nPage
);

Arguments:

Name Type Description
HwndPage HWND Windows handle to the Page Sorter window.
hIGear HIGEAR The HIGEAR handle of the image you would like to insert into the GUI Page Sorter window.
nPage UINT Set this to the page number you would like to assign to the new HIGEAR image that you are adding to the GUI Page Sorter Window.

Return Value:

Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.

Supported Raster Image Formats:

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

Sample:

None

Example:

 
Copy Code
HIGEAR hIGear = 0;         // HIGEAR handle of image
AT_ERRCOUNT nErrCount = 0; // Tally of IG errors on the stack
HWND hwndPage = 0;         // Windows handle to GUI Page Sorter
 
IG_GUI_page_window_create_ex(0, IG_GRP_DEFAULT, WS_CHILD | WS_VISIBLE, 
    "Page Window", 10, 10, 320, 200, &hwndPage);
IG_load_file("kittens.bmp", &hIGear);
 
// Insert "kittens.bmp" as first image in GUI Page Sorter
nErrCount = IG_GUI_page_insert(hwndPage, hIGear, 1);

Remarks:

Set nPage to the page number that you would like ImageGear to assign to your newly inserted image. For example, if there are several images already in the GUI Page Sorter window, and you ask to insert the new image as page 3 (nPage = 3), the old page 3 becomes page 4, and the old page 4 becomes page 5, etc. The HIGEAR handles of the loaded images never change despite any changes in page numbers; all images retain their original HIGEAR handle values.

If you set nPage to a page number greater than the number of images in the GUI Page Sorter, the image will be appended. In other words, ImageGear will set its page number to the total number of pages + 1.

To delete an image (thumbnail) from the GUI Page Sorter window, use IG_GUI_page_remove().

Is this page helpful?
Yes No
Thanks for your feedback.