ImageGear for C and C++ on Windows v19.10 - Updated
IG_load_file_display
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Load Functions > IG_load_file_display

This function loads an image from the specified file into memory, creates HIGEAR handle for the image and simultaneously displays it.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_load_file_display(
   const LPSTR lpszFileName,
   DWORD dwGrpID,
   HWND hWnd,
   HDC hDC,
   LPFNIG_LOAD_DISP lpfnLoadDisp,
   LPVOID lpPrivateData,
   LPHIGEAR lphIGear
);

Arguments:

Name Type Description
lpszFileName const LPSTR Pointer to filename (including path if desired) of file to load and display.
dwGrpID DWORD Display group identifier that should be used for display operations.
hWnd HWND Handle of window where to draw image.
hDC HDC Windows Device Context of device or window in which to display image.
lpfnLoadDisp LPFNIG_LOAD_DISP Pointer to a callback function (or name of callback function) to call when image has been loaded, but before it is displayed.
lpPrivateData LPVOID Pointer to a private data area. This pointer will be passed to the callback function when it is called.
lphIGear LPHIGEAR pointer to a variable of type HIGEAR to hold the returned ImageGear HIGEAR handle of the newly loaded image.

Return Value:

Returns 0 if successful. Otherwise, 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:

Display

Remarks:

Since you may want to set display attributes prior to displaying, ImageGear first loads the image's header, creating its HIGEAR handle, then calls your callback function (with the image's HIGEAR handle and your lpPrivate pointer) so you can set display attributes, device rectangle, image rectangle, or perform other operations. When your callback function returns, ImageGear then displays the image, one raster line at a time, as the image is loaded.

See the description for callback type LPFNIG_LOAD_DISP, and see also the section Displaying Images for a discussion of display attributes and how to set them.