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:






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.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:






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.4.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Digital Paint C API Help