Available in LEADTOOLS Medical Imaging toolkits. |
L_DispContainerEnableCellLowMemoryUsage
#include "l_bitmap.h"
L_LTIVW_API L_INT EXT_FUNCTION L_DispContainerEnableCellLowMemoryUsage(hCon, nCellIndex, nHiddenCount, nFrameCount, pBitmapInfo, bEnable, uFlags)
HDISPCONTAINER hCon; |
/* handle to the container */ |
L_INT nCellIndex; |
/* index of a cell */ |
L_INT nHiddenCount; |
/* number of frame to load ahead */ |
L_INT nFrameCount; |
/* number of total frames */ |
DISPCONTAINERBITMAPINFO * pBitmapInfo; |
/* pointer to a frames information structure */ |
L_BOOL bEnable; |
/* enable or disable low memory usage */ |
L_UINT uFlags; |
/* reserved for future use */ |
Enables a method to load the frames only when viewed, in order to use the system memory efficiently.
Parameter |
Description |
hCon |
Handle to the container. |
nCellIndex |
A zero-based index of the cell being enabled. |
nHiddenCount |
Value that represents the number of unseen frames that the control will load. Setting this value, for example, to 2 makes the control load 2 frames before the viewed frames and 2 frames after the viewed frames. |
nFrameCount |
Value that represents the total number of frames that will be included in the specified cell. |
pBitmapInfo |
Pointer to the DISPCONTAINERBITMAPINFO structure that contains the bitmap information to being set. |
bEnable |
TRUE to enable low memory usage in the specified cell; FALSE to disable it. |
uFlags |
Reserved for future use. Pass 0. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
The low memory usage feature works by making the control stop from loading all of the frames at runtime. Instead, the control will load only the frames that are currently visible on the cell. The control will send a request each time the user scrolls down or up, changes the number of visible frames, etc. For example, suppose the cell layout is a 2X2 (See L_DispContainerSetCellProperties), and the user needs to load more than 100000 frames. Instead of loading them all, this function will send a callback (DISPCONTAINERFRAMEREQUESTEDCALLBACK) when the cell is loaded, requesting 4 frames (1, 2, 3 and 4) (because the cell is 2X2). Once the user scrolls down the cell to view frame number 5, frame number 1 will be disposed of because it is no longer visible, and the callback will be fired to request frame number 5. When frames are requested, the user is supposed to send them to the control using the function L_DispContainerSetRequestedImage.
nHiddenCount allows the control to load a specified number of frames in advance (so if you have a 2X2 cell and you set nHiddenCount to 3, the method will request (1, 2, 3, 4, 5, 6, 7). The function, will also normally request 0, -1, -2. But since those indexes are not valid, the control will not request them.
To get the current frames request callback function, call L_DispContainerGetLowMemoryUsageCallBack.
To set the current frames request callback function, call L_DispContainerSetLowMemoryUsageCallBack.
If the user does not need to use the low memory usage feature to load images, he can send a bitmap list directly to the control using the L_DispContainerSetCellBitmapList function.
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. |
Platforms
Windows 2000 / XP/Vista.
See Also
Example
For an example, refer to L_DispContainerSetLowMemoryUsageCallBack.