ImageGear for C and C++ on Linux v20.0 - Updated
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Callback Register Functions > IG_file_IO_register

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


Copy Code
        LPFNIG_READ lpfnReadFunc,
        LPFNIG_WRITE lpfnWriteFunc, 
        LPFNIG_SEEK lpfnSeekFunc 


Name Type Description
lpfnReadFunc LPFNIG_READ Far pointer to your function to be called for READs.
lpfnWriteFunc LPFNIG_WRITE Far pointer to your function to be called for WRITEs.
lpfnSeekFunc LPFNIG_SEEK 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.


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  */


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.

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