Available in LEADTOOLS Medical Imaging toolkits. |
LImageViewer::EnableLowMemoryUsageCallBack
#include "ltwrappr.h"
L_BOOL LImageViewer::EnableLowMemoryUsageCallBack(bEnable)
L_BOOL bEnable; |
/* flag */ |
Enables or disables the LImageViewer::LowMemoryUsageCallBack function.
Parameter |
Description |
|
bEnable |
Flag that indicates whether to enable or disable the LImageViewer::LowMemoryUsageCallBack function. Possible values are: |
|
|
Value |
Meaning |
|
TRUE |
Enable the LImageViewer::LowMemoryUsageCallBack function. |
|
FALSE |
Disable the LImageViewer::LowMemoryUsageCallBack function. |
Returns
The previous setting.
Comments
Call this function to enable or disable the Low Memory Usage callback overridable function for your class object. This will enable or disable the callback functions, which exist in the calling object.
Required DLLs and Libraries
LTIVW For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
See Also
Functions: |
LImageViewer::LowMemoryUsageCallBack, LImageViewer::EnableActionCallBack, LImageViewer::ActionCallBack, Class Members |
Topics: |
|
|
|
|
Example
This example shows how to use the low memroy usage feature to display a medical image with multiple pages. it will also invert all the bitmap to show the invert function works even if the bitmap is not loaded yet.
#ifdef LImageViewerChild class LImageViewerChild :public LImageViewer { virtual L_INT FramesRequestedCallBack (L_INT nCellIndex, L_UINT * puFramesRequested, L_UINT uLength); }; #endif L_INT LImageViewerChild::FramesRequestedCallBack (L_INT nCellIndex, L_UINT * puFramesRequested, L_UINT uLength) { L_INT nI; LOADFILEOPTION LoadOption; BITMAPHANDLE * pBitmap; LBitmap BitmapHandles; pBITMAPHANDLE pBitmapHandle; if (uLength == 0) return 0; LBaseFile::GetDefaultLoadFileOption(&LoadOption, sizeof(LOADFILEOPTION)); pBitmap = (pBITMAPHANDLE)malloc(sizeof(BITMAPHANDLE) * uLength); for (nI = 0; nI < (L_INT)uLength; nI++) { LoadOption.PageNumber = puFramesRequested[nI]; BitmapHandles.Load(TEXT("%UserProfile%\\My Documents\\LEADTOOLS Images\\xa.dcm"), 0, ORDER_BGRORGRAY, &LoadOption, NULL); pBitmapHandle = BitmapHandles.GetHandle(); memcpy(&pBitmap[nI], pBitmapHandle, sizeof(BITMAPHANDLE)); BitmapHandles.SetHandle(NULL, FALSE); } SetRequestedImage( nCellIndex, pBitmap, (L_INT *) puFramesRequested, uLength, 0); return SUCCESS; } L_INT LImageViewer_EnableCellLowMemoryUsageExample(LImageViewer& ImageViewer) { FILEINFO FileInfo; pDISPCONTAINERBITMAPINFO pBitmapInfo; L_INT nI, nRet; LBitmapBase LeadBitmap; LFile LeadFile; LeadFile.SetBitmap(&LeadBitmap) ; LeadFile.SetFileName(TEXT("%UserProfile%\\My Documents\\LEADTOOLS Images\\xa.dcm")); nRet = LeadFile.GetInfo(&FileInfo, sizeof(FILEINFO)) ; if(nRet != SUCCESS) return nRet; pBitmapInfo = (DISPCONTAINERBITMAPINFO *)malloc(sizeof(DISPCONTAINERBITMAPINFO) * FileInfo.TotalPages); for (nI = 0; nI < FileInfo.TotalPages; nI++) { pBitmapInfo[nI].uHeight = FileInfo.Height; pBitmapInfo[nI].uWidth = FileInfo.Width; pBitmapInfo[nI].uXResolution = FileInfo.XResolution; pBitmapInfo[nI].uYResolution = FileInfo.YResolution; } ImageViewer.InsertCell( 0, 0); ImageViewer.EnableLowMemoryUsageCallBack(TRUE); ImageViewer.EnableCellLowMemoryUsage(0, 0, FileInfo.TotalPages, pBitmapInfo, 0); // invert all the frames in the cell. for (nI = 0; nI < FileInfo.TotalPages; nI ++) { ImageViewer.InvertBitmap( 0, nI, 0); } return SUCCESS; }