#include "Ltwrappr.h"
L_INT LRasterPaint::SetDCExtents(prcRect)
Sets the boundaries of the device context (DC).
Pointer to a RECT structure that contains the boundaries of the user DC.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes |
It is better to set the boundaries of the device context (DC) before calling any functions that use the DC. In addition, the device context boundaries should be updated whenever the old boundaries become invalid, such as when the client area of the window has been resized.
Call this function before calling any of the following:
Required DLLs and Libraries
L_INT LRasterPaint_SetDCExtentsExample( CWnd* pWnd, LRasterPaint* pRstp, UINT state, L_INT cxClient, L_INT cyClient )
{
UNREFERENCED_PARAMETER(pWnd);
UNREFERENCED_PARAMETER(state);
L_INT nRet;
RECT rcNewRect, rcDCRect ;
SetRect ( &rcNewRect, 0, 0, cxClient, cyClient ) ;
/* Do the program sizing stuff */
nRet = pRstp->GetDCExtents ( &rcDCRect ) ;
if(nRet != SUCCESS)
return nRet;
if ( ! EqualRect ( &rcNewRect, &rcDCRect ) )
{
nRet = pRstp->SetDCExtents ( &rcNewRect ) ;
if(nRet != SUCCESS)
return nRet;
}
return SUCCESS;
}