PAINTSHAPE

Summary

The PAINTSHAPE structure holds information about shapes.

Syntax

typedef struct _PAINTSHAPE 
{ 
   L_INT nSize; 
   L_UINT32 dwMask; 
   PAINTSHAPEBACKSTYLE nBackgroundStyle; 
   COLORREF crBackgroundColor; 
   pBITMAPHANDLE pBackgroundTileBitmap; 
   PAINTSHAPEBORDERSTYLE nBorderStyle; 
   L_INT nBorderWidth; 
   PAINTSHAPEBORDERBRUSHSTYLE nBorderBrushStyle; 
   COLORREF crBorderColor; 
   HBITMAP hBorderTileBitmap; 
   PAINTSHAPEGRADIENTSTYLE nGradientStyle; 
   COLORREF crGradientStartColor; 
   COLORREF crGradientEndColor; 
   L_UINT    uGradientSteps; 
   PAINTSHAPEBORDERENDCAP nBorderEndCap; 
   L_INT nRoundRectEllipseWidth; 
   L_INT nRoundRectEllipseHeight; 
   L_INT nOpacity; 
   pBITMAPHANDLE pTexture; 
} PAINTSHAPE,  *pPAINTSHAPE; 

Members

nSize

Size of this structure.

dwMask

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

Value Meaning
PSF_ALL All the fields contain valid data.
PSF_BACKGROUNDSTYLE The nBackgroundStyle field contains valid data.
PSF_BACKGROUNDCOLOR The crBackgroundColor field contains valid data.
PSF_BACKGROUNDTILEBITMAP The pBackgroundTileBitmap field contains valid data.
PSF_BORDERSTYLE The nBorderStyle field contains valid data.
PSF_BORDERWIDTH The nBorderWidth field contains valid data.
PSF_BORDERBRUSHSTYLE The nBorderBrushStyle field contains valid data.
PSF_BORDERCOLOR The crBorderColor field contains valid data.
PSF_BORDERTILEBITMAP The hBorderTileBitmap field contains valid data.
PSF_GRADIENTSTYLE The nGradientStyle field contains valid data.
PSF_GRADIENTSTARTCOLOR The crGradientStartColor field contains valid data.
PSF_GRADIENTENDCOLOR The crGradientEndColor field contains valid data.
PSF_GRADIENTSTEPS The uGradientSteps field contains valid data.
PSF_BORDERENDCAP The nBorderEndCap field contains valid data.
PSF_ROUNDRECTELLIPSEWIDTH The nRoundRectEllipseWidth field contains valid data.
PSF_ROUNDRECTELLIPSEHEIGHT The nRoundRectEllipseHeight field contains valid data.
PSF_OPACITY The nOpacity field contains valid data.
PSF_TEXTURE The pTexture field contains valid data.

The values can be combined using the bitwise OR operator ( | )

nBackgroundStyle

An enumerated type that indicates the shape's background style. For a list of possible values, refer to PAINTSHAPEBACKSTYLE.

image\PntBkgnd.gif

crBackgroundColor

The COLORREF value that specifies the color to use for the shape's background color, when nBackgroundStyle is PAINT_SHAPE_BACK_STYLE_OPAQUE.

pBackgroundTileBitmap

Pointer to the bitmap handle referencing the bitmap to be used for the shape's background, when nBackgroundStyle is PAINT_SHAPE_BACK_STYLE_TILEDIMAGE. The BITMAPHANDLE pointer should still be valid after setting this field.

nBorderStyle

An enumerated type that indicates the shape's border style. For a list of possible values, refer to PAINTSHAPEBORDERSTYLE.

nBorderWidth

Value indicating the shape's border width, in pixels. Valid values are 1 to 100.

image\PntBdrW.gif

nBorderBrushStyle

Value indicating the brush style to be used to draw the shape's border. For a list of possible values, refer to PAINTSHAPEBORDERBRUSHSTYLE.

image\PntBdrBsh.gif

crBorderColor

The COLORREF value that specifies the color to be used to draw the shape's border.

hBorderTileBitmap

Specifies the DDB to be used to draw the shape's border. The DDB, should still be valid after setting this field.

nGradientStyle

Specifies the shape's background gradient type when nBackgroundStyle is PAINT_SHAPE_BACK_STYLE_GRADIENT. For a list of possible values, refer to PAINTSHAPEGRADIENTSTYLE.

crGradientStartColor

The COLORREF value that specifies the color to use as the starting color for the background gradient fill.

crGradientEndColor

The COLORREF value that specifies the color to use as the ending color for the background gradient fill.

uGradientSteps

Number of gradient color steps. Valid values are 2 to 255.

image\PntGrdStp.gif

nBorderEndCap

An enumerated type that indicates how the ends of lines will be drawn. For a list of possible values, refer to PAINTSHAPEBORDERENDCAP.

image\PntBdrCap.gif

nRoundRectEllipseWidth

Value indicating the width, in pixels, of the ellipse used to create a rounded rectangle. Valid values are 0 to 500.

nRoundRectEllipseHeight

Value indicating the height, in pixels, of the ellipse used to create a rounded rectangle. Valid values are 0 to 500.

nOpacity

Value indicating the transparency of the shape when combined with the painting canvas. Valid values are 0 to 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\PntShpOpc.gif

pTexture

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

image\PntShpTxr.gif

Comments

The default values for this structure are:

nSize = sizeof (PAINTSHAPE)   
nBackgroundStyle = PAINT_SHAPE_BACK_STYLE_OPAQUE   
crBackgroundColor = RGB (255, 255, 255)   
pBackgroundTileBitmap = NULL   
nBorderStyle = PAINT_SHAPE_BORDER_STYLE_SOLID   
nBorderWidth = 1   
nBorderBrushStyle = PAINT_SHAPE_BORDER_BRUSH_STYLE_COLOR   
crBorderColor = RGB (0,0,0)   
hBorderTileBitmap = NULL   
nGradientStyle = PAINT_SHAPE_GRADIENT_STYLE_RECTANGLE_TO_C   
crGradientStartColor = RGB (0,0,0)   
crGradientEndColor = RGB (255, 255, 255)   
uGradientSteps = 255   
nBorderEndCap = PAINT_SHAPE_BORDER_ENDCAP_SQUARE   
nRoundRectEllipseWidth = 0   
nRoundRectEllipseHeight = 0   
nOpacity = 0   
pTexture = NULL 

pPAINTSHAPE is a pointer to a PAINTSHAPE structure.

Usage

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

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