L_PntInit

Summary

Initializes the paint handle.

Syntax

#include "LtPnt.h"

L_LTPNT_API L_INT L_PntInit(ppPaint)

Parameters

ppPAINTHANDLE ppPaint

Pointer to a pointer to a paint handle to be initialized.

Returns

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

Comments

This function must be called before calling any other paint functions.

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

For every call to L_PntInit there must be a call to L_PntFree.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example shows the minimum requirements for painting a rectangle shape.

L_INT PntInitExample(HWND hWnd) 
{ 
   L_INT nRet; 
   pPAINTHANDLE pPaint ; 
   HDC          hDC ; 
   RECT         rcShapeRect ; 
 
   /* Initiate the Paint toolkit */ 
   nRet  = L_PntInit ( &pPaint ); 
   if ( SUCCESS != nRet) 
   { 
      return nRet ; 
   } 
 
   /*Get the device context*/ 
   hDC = GetDC ( hWnd ) ; 
 
   /* Set the rectangle coordinates with respect to the DC dimensions*/ 
   SetRect ( &rcShapeRect, 10, 10, 100, 100 ) ; 
 
   /* Set the DC Extents */ 
   RECT rcClient; 
   GetClientRect(hWnd, &rcClient); 
   nRet = L_PntSetDCExtents ( pPaint, &rcClient ); 
 
   /* Use the default properties for the shape to draw a rectangle*/ 
   nRet = L_PntDrawShapeRectangle ( pPaint, hDC, &rcShapeRect ) ;  
   if(nRet != SUCCESS) 
      return nRet; 
 
   /* Release the device context*/ 
   ReleaseDC ( hWnd, hDC ) ; 
 
   // Free the paint tools handle. 
   L_PntFree ( pPaint ) ; 
 
   return SUCCESS ; 
} 

Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 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.