LImageViewer::GetBounds

#include "ltwrappr.h"

L_INT LImageViewer::GetBounds (lpRect, uFlags);

RECT L_FAR * lpRect;

/* pointer to a structure */

L_UINT uFlags;

/* reserved for future use */

Gets the bounding rectangle for the container. This function is available only in the Medical Imaging Suite toolkits.

Parameter

Description

lpRect

A pointer to a RECT structure to be updated with the bounding rectangle of the container.

uFlags

Reserved for future use. Must be zero.

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

Functions:

LImageViewer::Create, LImageViewer::SetBounds, LImageViewer::SetProperties, LImageViewer::GetProperties, LImageViewer::GetWindowHandle, LImageViewer::Destroy, Class Members

Topics:

Using the Image Viewer

 

Window Control/Image Viewer Functions: Using the Image Viewer

Example

#define RECT_HEIGHT(lpRect)      ((lpRect)->bottom - (lpRect)->top) 
#define RECT_WIDTH(lpRect)       ((lpRect)->right  - (lpRect)->left) 
// This function determines whether the container's client area is different from its parent's. 
void 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); 

   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; 

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

   wndContainer.Detach() ; 
}