Setting DigitalPaint Properties

LEADTOOLS DigitalPaint provides several types of painting abilities, including:

Each of these is considered a paint "group" and each group has its own set of paint properties that can be set. The values set for these properties control the paint results. For example, these properties determine:

Each group of properties has a group-specific structure used for getting or setting the properties. These structures are given below:

PAINTBRUSH

PAINTFILL

PAINTREGION

PAINTSHAPE

PAINTTEXT

Every structure has the dwMask field that will let the user specify the valid fields within the structure. In addition, there are default values for the members of each structure, which will be used if the user does not set paint properties.

To get the current properties for a group, call L_PntGetProperty. This function requires a valid paint handle, the paint group to get, and a pointer to the appropriate group-specific structure. L_PntGetProperty will update the group-specific structure with the current property values.

To set the properties for a group, call L_PntSetProperty. This function requires a valid paint handle, the paint group to set, and a pointer to the appropriate group-specific structure. The structure should contain valid data for setting the properties.

The following is a simple example for setting the shape group properties. (It assumes the paint handle has been initialized.):

//The paint shape structure that will be used to set the shape properties   
PAINTSHAPE shape;   
//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    
L_PntSetProperty ( pPaint, PAINT_GROUP_SHAPE, &shape ) ; 

This example uses the constant PAINT_GROUP_SHAPE to identify the group that will be set. The toolkit has the following group constants:

PAINT_GROUP_BRUSH

PAINT_GROUP_FILL

PAINT_GROUP_REGION

PAINT_GROUP_SHAPE

PAINT_GROUP_TEXT

In addition to setting the paint properties, other information should be set before actually painting. This includes:

These properties are referred to as the DigitalPaint metrics. For more information, refer to Setting General DigitalPaint Information.

Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Digital Paint C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.