Minimum buffer size required to save the bitmap or file.
Address of a pointer to the buffer to save. The callback function allows the user to reallocate the buffer. When reallocating a buffer, the buffer address can change. This parameter should be updated with the new address of the reallocated buffer.
Pointer to a variable that contains the actual buffer size. For the bitmap or file to be saved, *pdwBufferSize must be greater than or equal to uRequiredSize.
A void pointer that can be used to access a variable or structure containing data that the callback function needs. This provides a way to receive data indirectly from the function that uses this callback function. (This is the same pointer passed in the pUserData parameter of the calling function.)
Keep in mind that this is a void pointer, which must be cast to the appropriate data type within the callback function.
|SUCCESS||The function was successful.|
|FAILURE||An error occurred.|
This callback function is optional, but recommended. If the callback is not used, then the user must allocate a buffer that is large enough to hold the memory file. If the buffer is not large enough and the callback is not used, the function will fail.
If the user provides a callback function, it must reallocate the buffer to be at least uRequiredSize bytes. The ppBuffer parameter must be updated with the new buffer. The pdwBufferSize parameter must be updated with the size of the new buffer.
If the callback successfully reallocates the buffer, it should return SUCCESS.
If the callback fails to successfully reallocate the buffer, it should return FAILURE.
Required DLLs and Libraries
typedef struct _tagMYBUFFER
} MYBUFFER, *pMYBUFFER;
L_INT EXT_CALLBACK ExampleSaveBufferCB(L_SIZE_T uRequiredSize,
L_UCHAR ** ppBuffer,
L_SIZE_T * pdwBufferSize,
pMYBUFFER pMyBuffer = (pMYBUFFER)pUserData;
pTempBuffer = (L_UCHAR*)realloc(pMyBuffer->pBuffer, uRequiredSize);
wsprintf(szMsg, TEXT("** Reallocate from\n\t[0x%x, %d] to\n\t[0x%x, %d]\n"),
//MessageBox(NULL, szMsg, TEXT(""), MB_OK);
pMyBuffer->pBuffer = pTempBuffer;
pMyBuffer->dwBufferSize = uRequiredSize;
*ppBuffer = pMyBuffer->pBuffer;
*pdwBufferSize = uRequiredSize;
nRet = SUCCESS;
nRet = FAILURE;
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries