L_DispContainerGetDefaultWindowLevelValues

#include "l_bitmap.h"

L_LTIVW_API L_INT EXT_FUNCTION L_DispContainerGetDefaultWindowLevelValues(hCellWnd, nSubCellIndex, pnWidth, pnCenter, uFlags)

Gets the window level default values that are set when loading the image.

Parameters

L_HWND hCellWnd

A handle to the window that represents the cell on which the function's effect will be applied.

L_INT nSubCellIndex

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.

L_INT * pnWidth

Address of the variable to be updated with the default window level width value.

L_INT * pnCenter

Address of the variable to be updated with the default window level center value.

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

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.

Required DLLs and Libraries

Platforms

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

See Also

Functions

Topics

Example

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; 
} 

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

LEADTOOLS Medical Image Viewer C API Help