L_PntIsValid

#include "LtPnt.h"

L_LTPNT_API L_INT L_PntIsValid(pPaint)

Determines the validity of the given paint handle.

Parameters

pPAINTHANDLE pPaint

Pointer to a paint handle.

Returns

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

Comments

The paint handle will be valid after calling L_PntInit, and will remain valid until L_PntFree is called.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example shows how to use the L_PntIsValid function.

L_INT PntIsValidExample(HWND hWnd,pPAINTHANDLE pPaint) 
{ 
   L_INT nRet; 
 
   /* Initiate the Paint toolkit */ 
   nRet = L_PntInit ( &pPaint ); 
   if ( SUCCESS != nRet) 
   { 
      return nRet; 
   } 
 
   nRet = L_PntIsValid ( pPaint ); 
   if ( SUCCESS == nRet ) 
   { 
      HDC   hDC; 
      RECT  rcShape; 
 
      /* Get the device context */ 
      hDC = GetDC ( hWnd ) ; 
 
      /* Set the coordinates with respect to the DC dimensions */ 
      SetRect ( &rcShape, 10, 10, 150, 150 ) ; 
 
      /* Set the DC Extents */ 
      RECT rcClient; 
      GetClientRect(hWnd, &rcClient); 
      nRet = L_PntSetDCExtents ( pPaint, &rcClient ); 
 
      /* Use the current shape properties to draw an ellipse to DC (hDC) */ 
      nRet = L_PntDrawShapeEllipse ( pPaint, hDC, &rcShape ) ; 
      if(nRet != SUCCESS) 
         return nRet; 
 
      /* Release the device context */ 
      ReleaseDC ( hWnd, hDC ) ; 
   } 
   else 
   { 
      MessageBox ( hWnd, TEXT("Invalid PAINTHANDLE"), TEXT("Error"), MB_OK ) ; 
      return nRet; 
   } 
 
   return SUCCESS ; 
} 

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

LEADTOOLS Digital Paint C API Help