L_DispContainerGetPaintCallBack

#include "ltivw.h"

L_LTIVW_API L_INT L_DispContainerGetPaintCallBack(hCellWnd, ppfnPaintCallBack, ppUserData)

Gets the current paint callback function along with the user data, which were set using the L_DispContainerSetPaintCallBack function.

Parameters

L_HWND hCellWnd

A handle to the window that represents the Medical Viewer Cell.

DISPCONTAINERPAINTCALLBACK * ppfnPaintCallBack

Pointer to a pointer to a callback function to be updated with the last paint callback function set using the L_DispContainerSetPaintCallBack function.

LPVOID * ppUserData

Void pointer to be updated with the user defined data associated with the paint callback. If you are not interested in the user-defined data, pass NULL for this parameter.

Returns

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

Comments

To set the callback function used to handle painting, call L_DispContainerSetPaintCallBack.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This function set a paint call back that draws an ellipse in the middle of the cell.

L_INT EXT_CALLBACK PaintCallBack(HWND hCellWnd, HDC hMemDC, LPRECT lpRect, L_INT, L_INT, L_VOID *) 
{ 
   UNREFERENCED_PARAMETER(hCellWnd); 
   Ellipse(hMemDC, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); 
   return SUCCESS; 
} 
 
L_INT DispContainerGetPaintCallBackExample(HDISPCONTAINER hCon)  
{ 
   L_INT nRet; 
 
   DISPCONTAINERPAINTCALLBACK OldPaintCallBack; 
 
   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_DispContainerGetPaintCallBack(hCellWnd, &OldPaintCallBack, NULL); 
 
   nRet = L_DispContainerSetPaintCallBack(hCellWnd, PaintCallBack, NULL); 
 
   return SUCCESS; 
} 

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

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