ImageGear Professional DLL v17.1 for Windows Accusoft
IG_fltr_load_FD_format
Send Feedback  
ImageGear Professional DLL v17.1 for Windows > API Reference Guide > Core Component API Reference > Core Component Functions Reference > Filter Functions > IG_fltr_load_FD_format

Glossary Item Box

This function loads an image from an open file into memory and creates a HIGEAR handle for the image.

Declaration:

  Copy Code
AT_ERRCOUNT ACCUAPI IG_fltr_load_FD_format(
   AT_MODE nFormat,
   AT_INT fd,
   LONG lOffset,
   UINT nPage,
   UINT nTile,
   LPHIGEAR lphIGear
);

Arguments:

nFormat A constant indicating the file format of the input file. See enumIGFormats for possible values. Set to IG_FORMAT_UNKNOWN to let ImageGear detect the file format.
fd Handle of the open file containing the image. This handle can be obtained from Microsoft Windows functions such as CreateFile(), and cast to AT_INT for passing to the function parameter. FILE pointers returned by functions such as fopen(), and file handles returned by functions such as _sopen_s() are not supported.
lOffset Offset to image in the file.
nPage Page number to load if this is a multi-page file. Note that page numbers begin at 1, not 0. Set nPage to 1 if this is not a multi-page file.
nTile Tile number to load, set to 1 for non-tiled image.
lphIGear ImageGear handle returned.

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 Professional.

Sample:

None

Example:

  Copy Code
HIGEAR    hIGear;        // Will hold handle returned by IG_fltr_load_file
AT_ERRCOUNT nErrCount;    // Count of errs on stack upon ret from func*/
HANDLE      fd;            //File Descriptor
fd = CreateFile(_T("picture.tif"), GENERIC_READ,
        0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if(fd != INVALID_HANDLE_VALUE)
{
    // Load the selected image
    nErrCount = IG_fltr_load_FD_format(IG_FORMAT_TIF, (AT_INT)fd, 0, 1, 0, &hIGear);
    CloseHandle(fd);
    if(nErrCount == 0)
    {
        // ...

        // Delete the image
        IG_image_delete(hIGear);
    }
}

Remarks:

If nFormat = IG_FORMAT_UNKNOWN then ImageGear attempts to detect the file format automatically, and then loads the image. Otherwise, ImageGear skips the file format detection and loads the file with the specified format filter.

See also the section Using the Format Filters API for Image Loading and Getting Information.

©2012. Accusoft Corporation. All Rights Reserved.