Gets the window level default values that are set when loading the image.
#include "ltivw.h"
L_LTIVW_API L_INT EXT_FUNCTION L_DispContainerGetDefaultWindowLevelValues(hCellWnd, nSubCellIndex, pnWidth, pnCenter, uFlags)
A handle to the window that represents the cell on which the function's effect will be applied.
A zero-based index into the image list attached to the cell specified in nCellIndex. This image contains the default window level values being retrieved. Pass -2 to retrieves the default window level values of the selected sub-cell.
Address of the variable to be updated with the default window level width value.
Address of the variable to be updated with the default window level center value.
Reserved for future use. Pass 0.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function will not get the current window level values. To get the current window level values call L_DispContainerGetActionProperties. To set the current window level values call L_DispContainerSetActionProperties
This function will not get the current window level values; it will get the default ones. The default values can be set using either by using L_DispContainerSetDefaultWindowLevelValues or can be internally calculated when the images are first set in the control using either L_DispContainerSetCellBitmapList or L_DispContainerSetRequestedImage (when the low memory usage feature is enabled). For more information about the low memory usage feature, refer to the function L_DispContainerEnableCellLowMemoryUsage.
To reset the window level values to the default values use the function L_DispContainerResetWindowLevelValues.
The toolkit comes in Win32 and x64 editions that can support development of software applications for any of the following environments:
Windows 10
Windows 8
Windows 7
Windows Vista
Windows XP
Windows 2000
This examples changes the default window level value by decrease the width by 100. Then resets the images based on the new value.
L_INT DispContainerGetDefaultWindowLevelExamples(HDISPCONTAINER hCon)
{
L_INT nRet;
L_INT nWidth;
L_INT nCenter;
if (L_DispContainerGetCellCount(hCon, 0) == 0)
{
MessageBox(NULL, TEXT("you must at least have one cell added to the viewer"), TEXT("No Cell attached"), MB_OK);
return FAILURE;
}
HWND hCellWnd = L_DispContainerGetCellWindowHandle(hCon, 0, 0);
nRet = L_DispContainerGetDefaultWindowLevelValues(hCellWnd, 0, &nWidth, &nCenter, 0);
if (nRet != SUCCESS)
return nRet;
nWidth -= 100;
nRet = L_DispContainerSetDefaultWindowLevelValues(hCellWnd, 0, nWidth, nCenter, 0);
if (nRet != SUCCESS)
return nRet;
nRet = L_DispContainerResetWindowLevelValues(hCellWnd, 0, 0);
if (nRet != SUCCESS)
return nRet;
return SUCCESS;
}