L_PntSetProperty

#include "LtPnt.h"

L_LTPNT_API L_INT L_PntSetProperty(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 */

Sets 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

 

PAINT_GROUP_BRUSH

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

 

PAINT_GROUP_SHAPE

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

 

PAINT_GROUP_REGION

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

 

PAINT_GROUP_FILL

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

 

PAINT_GROUP_TEXT

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

pProperty

Pointer to a PAINTXXX structure that contains the property values to set. The type of structure that this parameter points to is indicated by the nGroup parameter. The user should set the nSize and dwMask of any of the PAINTXXX structures with proper values before calling this function.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

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_PntGetProperty, 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 PntSetPropertyExample(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 desired shape properties using the field masks*/
   shape.nSize                = sizeof ( PAINTSHAPE ) ;
   shape.dwMask               = PSF_BACKGROUNDSTYLE   |
                                PSF_BORDERSTYLE       |
                                PSF_BORDERCOLOR       |
                                PSF_BORDERWIDTH       |
                                PSF_BORDERENDCAP      |
                                PSF_GRADIENTSTYLE     |
                                PSF_GRADIENTSTARTCOLOR|
                                PSF_GRADIENTENDCOLOR  |
                                PSF_GRADIENTSTEPS     ;
   shape.nBackgroundStyle     = PAINT_SHAPE_BACK_STYLE_GRADIENT; 
   shape.nBorderStyle         = PAINT_SHAPE_BORDER_STYLE_DOT ; 
   shape.crBorderColor        = RGB ( 255, 0, 0 ) ;
   shape.nBorderWidth         = 10 ;
   shape.nBorderEndCap        = PAINT_SHAPE_BORDER_ENDCAP_ROUND ; 
   shape.nGradientStyle       = PAINT_SHAPE_GRADIENT_STYLE_CONE_FROM_L ;
   shape.crGradientStartColor = RGB ( 255, 192, 0 ) ;
   shape.crGradientEndColor   = RGB ( 0, 0, 255 ) ;
   shape.uGradientSteps       = 255 ;

   /*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 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 ;
}