#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.
A handle to the window that represents the Medical Viewer Cell.
Pointer to a pointer to a callback function to be updated with the last paint callback function set using the L_DispContainerSetPaintCallBack function.
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.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
To set the callback function used to handle painting, call L_DispContainerSetPaintCallBack.
Required DLLs and Libraries
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;
}