LImageViewer::EnableCellLowMemoryUsage

Summary

Enables loading the frames only when viewed, in order to use the system memory efficiently.

Syntax

#include "ltwrappr.h"

L_INT LImageViewer::EnableCellLowMemoryUsage(nCellIndex, nHiddenCount, nFrameCount, pBitmapInfo, uFlags)

Parameters

L_INT nCellIndex

A zero based index of the cell to enable/disable the low memory usages.

L_INT nHiddenCount

The number of unseen frames that the control will load. For example, setting this value to 2 makes the control loads 2 frames before the viewed frames and 2 frames after the viewed frames.

L_INT nFrameCount

The total number of frames that will be included in the specified cell.

DISPCONTAINERBITMAPINFO *pBitmapInfo

Pointer to the DISPCONTAINERBITMAPINFO structure that contains the bitmap information to being set.

L_UINT uFlags

Reserved for future use. Pass 0.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

The low memory usage feature works by stopping the control from loading all 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 LImageViewerCell::SetCellProperties), and the user needs to load more than 100000 frames. The control will not load them all. This function will send a callback (LImageViewerCell::LowMemoryUsageCallBack) 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 show 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 LImageViewerCell::SetRequestedImage function.

For the callback, use the function LImageViewerCell::LowMemoryUsageCallBack. To use this callback, it must first be set by calling LImageViewerCell::EnableLowMemoryUsageCallBack.

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 LImageViewerCell::SetCellBitmapList function.

Required DLLs and Libraries

See Also

Functions

Topics

Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Medical Image Viewer C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.