L_LTPNT_API L_INT L_PntInit(ppPaint)
Initializes the paint handle.
Pointer to a pointer to a paint handle to be initialized.
|SUCCESS||The function was successful.|
|< 1||An error occurred. Refer to Return Codes.|
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
This example shows the minimum requirements for painting a rectangle shape.
L_INT PntInitExample(HWND hWnd)
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 */
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)
/* Release the device context*/
ReleaseDC ( hWnd, hDC ) ;
// Free the paint tools handle.
L_PntFree ( pPaint ) ;
return SUCCESS ;