PAINTBRUSH

typedef struct _PAINTBRUSH 
{ 
   L_INT nSize; 
   L_UINT32 dwMask; 
   PAINTTOUCH Touch; 
   L_INT nDiameter; 
   PAINTHARDNESS Hardness; 
   L_INT nSpacing; 
   L_INT nDensity; 
   L_INT nOpacity; 
   L_INT nFadeOutRate; 
   pBITMAPHANDLE pTexture; 
} PAINTBRUSH,  *pPAINTBRUSH; 

The PAINTBRUSH structure holds information about the paintbrush.

Members

nSize

Size of this structure.

dwMask

Flags that indicate which structure members contain valid information. Possible values are:

Value Meaning
PBF_ALL All fields contain valid data.
PBF_TOUCH The Touch field contains valid data.
PBF_DIAMETER The nDiameter field contains valid data.
PBF_HARDNESS The Hardness field contains valid data.
PBF_SPACING The nSpacing field contains valid data.
PBF_DENSITY The nDensity field contains valid data.
PBF_OPACITY The nOpacity field contains valid data.
PBF_FADEOUTRATE The nFadeOutRate field contains valid data.
PBF_TEXTURE The pTexture field contains valid data.

These values can be combined using the bit-wise OR operator (|).

Touch

Structure that contains information about the touch properties. For more information on these properties, refer to PAINTTOUCH.

nDiameter

Value indicating the diameter of the brush, in pixels. Valid values are between 1 and 200.

image\PntDiam.gif

Hardness

Structure that contains information about the hardness of the brush. For more information, refer to PAINTHARDNESS.

nSpacing

Indicates the spacing of the discrete drops of the paintbrush, or how frequently the brush tip touches the painting surface during a stroke. When the spacing is 30, this means that the brush tip will touch the painting surface once every 30 pixels. Valid values are between (1-1000).

image\PntSpace.gif

nDensity

Value indicating the amount of paint the brush applies with each stroke. Increasing the density of the brush is comparable to increasing the number of bristles in the brush. With more bristles, more paint is applied in a stroke. Similarly, decreasing the density decreases the number of bristles in the brush. With fewer bristles, less paint is applied in a stroke. Valid values are 1 to 100 and represent a percentage. A value of 100% results in the surface being completely covered with paint. A value of 1% results in very little paint being applied to the surface.

image\PntDens.gif

nOpacity

Value indicating the transparency of the brush touch when combined with the painting canvas. Valid values are between (0-255). A color or an image with an opacity of 255 is transparent. A color or an image with an opacity of 0 is completely opaque (solid).

image\PntOpac.gif

nFadeOutRate

Value indicating the rate at which the brush contents will fade (become more transparent). Valid values are between (0-10000). 0 means no fade-out will occur. Other values (1-10000) will increase the transparency of the brush contents every nSpacing pixels, until total fade-out is reached.

image\PntFade.gif

pTexture

Pointer to the bitmap handle that references the bitmap used to simulate paper texture. This makes it appears as if the painting is done on paper having that texture. The BITMAPHANDLE pointer should still be valid after setting this field.

image\PntTextr.gif

Comments

The default values for this structure are:

nSize = sizeof (PAINTBRUSH)   
Touch.nContentsType = PAINT\_TOUCH\_CONTENTS\_COLOR   
Touch.crColor = RGB(0, 0, 0)   
Touch.nShape = PAINT\_TOUCH\_SHAPE\_CIRCLE   
Touch.pBitmap = NULL   
Touch.crTransparentColor   = RGB(0, 0, 0)   
nDiameter = 1   
Hardness.nDistributionType = PAINT\_HARDNESS\_DISTRB\_TYPE\_0   
Hardness.nValue = 1   
nSpacing = 1   
nDensity = 100   
nOpacity = 0   
nFadeOutRate = 0   
pTexture = NULL 

pPAINTBRUSH is a pointer to a PAINTBRUSH structure.

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

LEADTOOLS DigitalPaint C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.