This function will be called during file operations when a WRITE is required.
Copy Code
|
|
---|---|
typedef LONG (ACCUAPI LPFNIG_WRITE) (
LONG fd,
const LPBYTE lpBuffer,
LONG lSize
);
|
Name | Type | Description |
---|---|---|
fd | LONG | File Descriptor handle. |
lpBuffer | const LPBYTE | Far pointer to buffer from which to write. |
lSize | LONG | Number of bytes to write. |
Return the number of bytes written, or -1 to indicate that an error occurred.
This function does not process image pixels.
Copy Code
|
|
---|---|
HIGEAR hIGear; /* HIGEAR handle of image */ LPFNIG_WRITE MyWriteFunc; /* To be called for file WRITEs */ { IG_file_IO_register ( NULL, MyWriteFunc, NULL ); /* Register it */ ... IG_save_file ( hIGear, "picture.bmp", IG_SAVE_BMP_UNCOMP ); ... } /* This will be called for each write during the above Save: */ LONG ACCUAPI MyWriteFunc ( LONG fd, LPBYTE lpBuffer, LONG lNumToWrite ) { LONG nNumActuallyWritten; ... return nNumActuallyWritten; /* Return count, or -1 for error */ |
This type of function is established by calling IG_file_IO_register().