The PAINTTEXT structure contains information for drawing text.
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;
Size of this structure.
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 ( | ).
Character string that contains the string to be drawn. The toolkit will copy this string to its internal data.
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.
An enumerated type that indicates the text border (outline) style. For a list of possible values, refer to PAINTTEXTBORDERBRUSHSTYLE.
Value that indicates the width or the text border, in pixels. Valid values are 1 to 100.
The COLORREF value that specifies the color to use to draw the text border (outline).
An enumerated type that indicates the text background style. For a list of possible values, refer to PAINTTEXTBACKSTYLE.
The COLORREF value that specifies the color to use for filling the text background when nBackgroundStyle is PAINT_TEXT_BACK_STYLE_OPAQUE.
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.
An enumerated type that indicates text alignment. For a list of possible values, refer to PAINTALIGNMENT.
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).
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.
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.
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