L_PntInit

#include "LtPnt.h"

L_LTPNT_API L_INT L_PntInit(ppPaint)

ppPAINTHANDLE ppPaint;

pointer to a pointer to a paint handle

Initializes the paint handle.

Parameter

Description

ppPaint

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

Returns

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

LTPNT

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:

L_PntIsValid, L_PntFree

Topics:

DigitalPaint Functions: Initializing and Freeing the Paint Handle

 

Initializing and Freeing DigitalPaint Handles

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 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Digital Paint C API Help