SaveBuffer event (ILEADRasterIO)
void SaveBuffer(long uRequiredSize); | |
Overview |
Refer to Using Memory-Resident Image Files. |
Remarks
This event is generated in a SaveBuffer process to tell the user that the allocated memory buffer is not large enough. This allows the user to reallocate the memory buffer so that it is at least ‘uRequiredSize’ bytes. The user should also set the SaveBufferAddress property to the address of the newly allocated buffer (if it has changed since last allocated), and the SaveBufferSize property to the size of the newly allocated buffer. Note that ‘uRequiredSize’ is the minimum required size of the buffer. The user can allocate a chunk of memory that is larger than ‘uRequiredSize’ if desired.
This event is generated only if the EnableSaveBufferEvent property is set to TRUE prior to calling the SaveBuffer method.
To abort the SaveBuffer process (if for example ‘uRequiredSize’ bytes cannot be reallocated), set the EnableSaveBufferEvent property to FALSE in the SaveBuffer event.
To summarize, when processing the SaveBuffer event you must
1. |
Reallocate the memory buffer to be at least ‘uRequiredSize’ bytes |
2. |
Set the SaveBufferAddress property to be the address of the reallocated memory buffer |
3. |
Set the SaveBufferSize property to be the size of the reallocated memory buffer |
4. |
If at least ‘uRequiredSize’ bytes cannot be reallocated, set the EnableSaveBufferEvent property to FALSE to abort the SaveBuffer process. |
For more information, refer to the SaveBuffer method.
See Also
Elements |
SaveBuffer method, SaveBufferSize property, SaveBufferAddress property, EnableSaveBufferEvent property, LoadBuffer method, SaveTileHeight property, SaveTileWidth property |
Topics |
|
|