Available in LEADTOOLS Medical Imaging toolkits. |
LImageViewer::GetBounds
#include "ltwrappr.h"
L_INT LImageViewer::GetBounds (lpRect, uFlags);
LPRECT lpRect; |
/* pointer to a structure */ |
L_UINT uFlags; |
/* reserved for future use */ |
Gets the bounding rectangle for the container.
Parameter |
Description |
lpRect |
A pointer to a RECT structure to be updated with the bounding rectangle of the container. |
uFlags |
Reserved for future use. Pass 0. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
The coordinates of lpRect are relative to the parent window coordinates. If the container window has no parent, the coordinates will be relative to the screen coordinates.
To set the bounding rectangle for the container, call LImageViewer::SetBounds.
Required DLLs and Libraries
LTIVW For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
See Also
Example
This function determines whether the container's client area is different from its parent's.
#if defined LEADTOOLS_V17_OR_LATER #define RECT_HEIGHT(lpRect) ((lpRect)->bottom - (lpRect)->top) #define RECT_WIDTH(lpRect) ((lpRect)->right - (lpRect)->left) L_INT LImageViewer_GetBoundsExample(LImageViewer& ImageViewer) { RECT rcRect; RECT rcParentRect; CWnd* pwndParent; CWnd wndContainer ; L_INT nRet = 0 ; // Get the container's bonding rectangle. nRet = ImageViewer.GetBounds(&rcRect, 0); if(nRet != SUCCESS) return nRet; nRet = wndContainer.Attach(ImageViewer.GetWindowHandle(0)) ; // Get the container window's parent pwndParent = wndContainer.GetParent(); // if the container has no parent then abort. if (pwndParent == NULL) return FAILURE; pwndParent->GetClientRect(&rcParentRect); // check if the container's client area is different from the parent's client area. if ((RECT_WIDTH(&rcRect) != RECT_WIDTH(&rcParentRect)) || (RECT_HEIGHT(&rcRect) != RECT_HEIGHT(&rcParentRect))) { nRet = ImageViewer.SetBounds(&rcParentRect, 0); if(nRet != SUCCESS) return nRet; } wndContainer.Detach() ; return SUCCESS; } #else #define RECT_HEIGHT(lpRect) ((lpRect)->bottom - (lpRect)->top) #define RECT_WIDTH(lpRect) ((lpRect)->right - (lpRect)->left) L_INT LImageViewer_GetBoundsExample(LImageViewer& ImageViewer) { RECT rcRect; RECT rcParentRect; CWnd* pwndParent; CWnd wndContainer ; L_INT nRet = 0 ; // Get the container's bonding rectangle. nRet = ImageViewer.GetBounds(&rcRect, 0); if(nRet != SUCCESS) return nRet; nRet = wndContainer.Attach(ImageViewer.GetWindowHandle(0)) ; // Get the container window's parent pwndParent = wndContainer.GetParent(); // if the container has no parent then abort. if (pwndParent == NULL) return FAILURE; pwndParent->GetClientRect(&rcParentRect); // check if the container's client area is different from the parent's client area. if ((RECT_WIDTH(&rcRect) != RECT_WIDTH(&rcParentRect)) || (RECT_HEIGHT(&rcRect) != RECT_HEIGHT(&rcParentRect))) { nRet = ImageViewer.SetBounds(&rcParentRect, 0); if(nRet != SUCCESS) return nRet; } wndContainer.Detach() ; return SUCCESS; } #endif // LEADTOOLS_V17_OR_LATER