ImageGear Professional DLL v17.1 for Windows Accusoft
IG_file_IO_register
Send Feedback  
ImageGear Professional DLL v17.1 for Windows > API Reference Guide > Core Component API Reference > Core Component Functions Reference > Callback Register Functions > IG_file_IO_register

Glossary Item Box

This function registers your own functions to be called to do Reads, Writes, and Seeks during image file transfers.

Declaration:

  Copy Code
AT_ERRCOUNT ACCUAPI IG_file_IO_register (
        LPFNIG_READ lpfnReadFunc,
        LPFNIG_WRITE lpfnWriteFunc, 
        LPFNIG_SEEK lpfnSeekFunc 
);

Arguments:

lpfnReadFunc Far pointer to your function to be called for READs.
lpfnWriteFunc Far pointer to your function to be called for WRITEs.
lpfnSeekFunc Far pointer to your function to be called for SEEKs.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

This function does not process image pixels.

Sample:

File IO

Example:

  Copy Code
LPFNIG_READ               MyReadFunc;      /* To be called for file READs */
{
HIGEAR           hIGear;     /* Will hold HIGEAR handle of image  */
 ...
IG_file_IO_register ( MyReadFunc, NULL, NULL );/* Register it */
 ...
IG_load_file ( "picture.bmp", &hIGear );
 ...
}
/* This will be called for each read during the above Load:   */
LONG  ACCUAPI MyReadFunc ( LONG fd, LPBYTE lpBuffer, 
        LONG lNumToRead )
{
LONG     nNumActuallyRead;
 ...   /* May transfer bytes to buffer in any way     */
return  nNumActuallyRead; /* Return count, or -1 for error  */
}

Remarks:

An argument should be NULL if you want ImageGear to perform that operation. See also the descriptions for typedefs LPFNIG_READ, LPFNIG_WRITE, and LPFNIG_SEEK.

©2012. Accusoft Corporation. All Rights Reserved.