L_PntInit

#include "LtPnt.h"

L_INT EXT_FUNCTION 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 OnPaintShape ( HWND hWnd )
{
   pPAINTHANDLE pPaint ;
   HDC                       hDC ;
   RECT                     rcShapeRect ;

   /* Initiate the Paint toolkit */
   if ( SUCCESS != L_PntInit ( &pPaint ) )
   {
      return FAILURE ; 
   }

   /*Get the device context*/ 
   hDC = GetDC ( hWnd ) ;

   /* Set the rectangle coordinates with respect to the DC dimensions*/
   SetRect ( &rcShapeRect, 10, 10, 100, 100 ) ;

   /* Use the default properties for the shape to draw a rectangle*/
   L_PntDrawShapeRectangle ( pPaint, hDC, &rcShapeRect ) ; 

   /* Release the device context*/
   ReleaseDC ( hWnd, hDC ) ;

   // Free the paint tools handle.
   L_PntFree ( pPaint ) ;

   return SUCCESS ;
}