PAINTTEXT

typedef struct _PAINTTEXT 
{ 
   L_INT nSize; 
   L_UINT32 dwMask; 
   LPTSTR pszText; 
   HFONT hFont; 
   PAINTTEXTBORDERBRUSHSTYLE nBorderBrushStyle; 
   L_INT nBorderWidth; 
   COLORREF crBorderColor; 
   PAINTTEXTBACKSTYLE nBackgroundStyle; 
   COLORREF crBackgroundColor; 
   pBITMAPHANDLE pBackgroundTileBitmap; 
   PAINTALIGNMENT nAlignment; 
   L_INT nOpacity; 
   pBITMAPHANDLE pTexture; 
   PAINTTRANSFORM TransformInfo; 
} PAINTTEXT, *pPAINTTEXT; 

The PAINTTEXT structure contains information for drawing text.

Members

nSize

Size of this structure.

dwMask

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

Value Meaning
PTF_ALL All the fields contain valid data.
PTF_TEXT The pszText field contains valid data.
PTF_FONT The hFont field contains valid data.
PTF_BORDERBRUSHSTYLE The nBorderBrushStyle field contains valid data.
PTF_BORDERWIDTH The nBorderWidth field contains valid data.
PTF_BORDERCOLOR The crBorderColor field contains valid data.
PTF_BACKGROUNDSTYLE The nBackgroundStyle field contains valid data.
PTF_BACKGROUNDCOLOR The crBackgroundColor field contains valid data.
PTF_BACKGROUNDTILEBITMAP The pBackgroundTileBitmap field contains valid data.
PTF_ALIGNMENT The nAlignment field contains valid data.
PTF_OPACITY The nOpacity field contains valid data.
PTF_TEXTURE The pTexture field contains valid data.
PTF_TRANSFORMINFO The TransformInfo field contains valid data.

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

pszText

Character string that contains the string to be drawn. The toolkit will copy this string to its internal data.

hFont

The font used to paint the text. This font should be a true type font. The toolkit will not copy this handle. Therefore, this font handle should still be valid after setting this field.

nBorderBrushStyle

An enumerated type that indicates the text border (outline) style. For a list of possible values, refer to PAINTTEXTBORDERBRUSHSTYLE.

nBorderWidth

Value that indicates the width or the text border, in pixels. Valid values are 1 to 100.

crBorderColor

The COLORREF value that specifies the color to use to draw the text border (outline).

nBackgroundStyle

An enumerated type that indicates the text background style. For a list of possible values, refer to PAINTTEXTBACKSTYLE.

crBackgroundColor

The COLORREF value that specifies the color to use for filling the text background when nBackgroundStyle is PAINT_TEXT_BACK_STYLE_OPAQUE.

pBackgroundTileBitmap

Pointer to the bitmap handle referencing the bitmap used to fill the text background when nBackgroundStyle is PAINT_TEXT_BACK_STYLE_TILEDIMAGE. The BITMAPHANDLE pointer should still be valid after setting this field.

nAlignment

An enumerated type that indicates text alignment. For a list of possible values, refer to PAINTALIGNMENT.

nOpacity

Value that indicates the transparency of the text when combined with the painting canvas. Valid values are 0 to 255. A color or an image with nOpacity of 255 is transparent. A color or an image with nOpacity of 0 is completely opaque (solid).

image\PntTxtOpc.gif

pTexture

Pointer to the bitmap handle referencing the bitmap that will simulate paper texture. Using a paper texture gives the appearance of painting on paper having that texture. The BITMAPHANDLE pointer should still be valid after setting this field.

image\PntTxtTxr.gif

TransformInfo

Structure that contains information used to transform the text output.

The nRotate structure field of TransformInfo will effect the text output result only when the nAlignment field is: (PAINT_ALIGNMENT_HCENTER | PAINT_ALIGNMENT_VCENTER ) Otherwise, the toolkit will consider nRotate to be 0.

image\PntTxtTrm1.gif
image\PntTxtTrm2.gif

Comments

The default values for this structure are:

nSize = sizeof (PAINTTEXT)   
pszText = NULL   
hFont = NULL   
nBorderBrushStyle = PAINT_TEXT_BORDER_BRUSH_STYLE_COLOR   
nBorderWidth = 1   
crBorderColor = RGB (0, 0, 0)   
nBackgroundStyle = PAINT_TEXT_BACK_STYLE_OPAQUE   
crBackgroundColor = RGB (255, 255, 255)   
pBackgroundTileBitmap = NULL   
nAlignment = PAINT_ALIGNMENT_HCENTER|PAINT_ALIGNMENT_VCENTER   
nOpacity = 0   
pTexture = NULL   
TransformInfo.nRotate = 0   
TransformInfo.Scale.cx = 100   
TransformInfo.Scale.cy = 100 

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.