ImageGear Professional v18.2 > 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
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_file_IO_register ( 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. |
Returns the number of ImageGear errors that occurred during this function call.
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.