L_PntGetProperty

#include "LtPnt.h"

L_LTPNT_API L_INT L_PntGetProperty(pPaint, nGroup, pProperty)

pPAINTHANDLE pPaint;

/* pointer to a paint handle */

PAINTGROUP nGroup;

/* type of paint properties */

const L_VOID * pProperty;

/* pointer to a PAINTXXXX structure */

Gets the specified paint properties.

Parameter

Description

pPaint

Pointer to a paint handle.

nGroup

Indicates the paint properties to get and the structure pointed to by pProperty. Possible values are:

 

Value

Meaning

 

PAINT4_GROUP_BRUSH

Get the Paintbrush properties. pProperty points to a PAINTBRUSH structure.

 

PAINT_GROUP_SHAPE

Get the Paint shape properties. pProperty points to a PAINTSHAPE structure.

 

PAINT_GROUP_REGION

Get the Paint region properties. pProperty points to a PAINTREGION structure.

 

PAINT_GROUP_FILL

Get the Paint fill properties. pProperty points to a PAINTFILL structure.

 

PAINT_GROUP_TEXT

Get the Paint fill properties. pProperty points to a PAINTTEXT structure.

pProperty

Pointer to a PAINTXXX structure to be updated with the specified property values. The type of structure that this parameter points to is indicated by the nGroup parameter.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

If this function is called after the paint handle is initialized, the default values will be returned. For more information about the default property values, refer to:

PAINTBRUSH

PAINTSHAPE

PAINTREGION

PAINTFILL

PAINTTEXT

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_PntSetProperty, L_PntDlgBrush, L_PntDlgFill, L_PntDlgRegion, L_PntDlgShape, L_PntDlgText, L_PntBrushLineTo, L_PntBrushMoveTo, L_PntApplyText, L_PntDrawShapeEllipse, L_PntDrawShapeLine, L_PntDrawShapePolyBezier, L_PntDrawShapePolygon, L_PntDrawShapeRectangle, L_PntDrawShapeRoundRect, L_PntRegionBorder, L_PntRegionColor, L_PntRegionEllipse, L_PntRegionPolygon, L_PntRegionRect, L_PntRegionRoundRect

Topics:

DigitalPaint Functions: Paint Properties

 

Setting DigitalPaint Properties

Example

This example shows the minimum requirements for painting a rectangle shape using some user defined properties.

 L_INT PntGetPropertyExample(HWND hWnd)
{
   L_INT nRet;
   pPAINTHANDLE pPaint ;
   PAINTSHAPE   shape ;
   HDC          hDC ;
   RECT         rcShapeRect ;

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

   /*Set the paint shape group properties */
   nRet = L_PntGetProperty ( pPaint, PAINT_GROUP_SHAPE, &shape ) ;
   if(nRet != SUCCESS)
      return nRet;

   /* Do some check and chang to the required properties*/
   if ( PAINT_SHAPE_BORDER_STYLE_SOLID == shape.nBorderStyle )
   {
      /* Set the desired shape properties using the field masks*/
      shape.nSize         = sizeof ( PAINTSHAPE ) ;
      shape.dwMask        = PSF_BORDERSTYLE |
                            PSF_BORDERWIDTH |
                            PSF_BORDERENDCAP;
      shape.nBorderStyle  = PAINT_SHAPE_BORDER_STYLE_DOT ;
      shape.nBorderWidth  = 10 ;
      shape.nBorderEndCap = PAINT_SHAPE_BORDER_ENDCAP_ROUND ;

      /*Set the paint shape group properties */
      nRet = L_PntSetProperty ( pPaint, PAINT_GROUP_SHAPE, &shape ) ;
      if(nRet != SUCCESS)
         return nRet;
   }

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

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

   /* Use the current shape properties to draw an 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 ;
}