L_PntSetDCExtents

Summary

Sets the boundaries of the device context (DC).

Syntax

#include "LtPnt.h"

L_LTPNT_API L_INT L_PntSetDCExtents(pPaint, prcRect)

Parameters

pPAINTHANDLE pPaint

Pointer to a paint handle.

const LPRECT prcRect

Pointer to a RECT structure that contains the boundaries of the user DC.

Returns

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

Comments

It is best 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

See Also

Functions

Topics

Example

This example shows how to set the user DC extents.

L_INT PntSetDCExtentsExample( HWND    hWnd, 
                                              UINT    state, 
                                              L_INT   cxClient, 
                                              L_INT   cyClient, 
                                              pPAINTHANDLE g_pPaint) 
{ 
   L_INT nRet; 
   UNREFERENCED_PARAMETER(hWnd); 
   UNREFERENCED_PARAMETER(state); 
   RECT rcNewRect, rcDCRect ;  
 
   SetRect ( &rcNewRect, 0, 0, cxClient, cyClient ) ; 
 
   /* Initiate the Paint toolkit */ 
   nRet = L_PntInit ( &g_pPaint ); 
  if ( SUCCESS != nRet) 
  { 
       return nRet; 
   } 
 
   /* Do the program sizing stuff */ 
   nRet = L_PntGetDCExtents ( g_pPaint, &rcDCRect ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   if ( ! EqualRect ( &rcNewRect, &rcDCRect ) ) 
   { 
      nRet = L_PntSetDCExtents ( g_pPaint, & rcNewRect ) ; 
      if(nRet != SUCCESS) 
         return nRet; 
   } 
   return SUCCESS; 
} 

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

LEADTOOLS Digital Paint C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.