Microsoft DirectX 8.1 (Visual Basic)

CONST_DTFLAGS

Defines flags used for drawing text.

Enum CONST_DTFLAGS
    DT_LEFT                 =       0
    DT_TOP                  =       0
    DT_CENTER               =       1
    DT_RIGHT                =       2
    DT_VCENTER              =       4
    DT_BOTTOM               =       8
    DT_WORDBREAK            =      16 (&H10)
    DT_SINGLELINE           =      32 (&H20)
    DT_EXPANDTABS           =      64 (&H40)
    DT_TABSTOP              =     128 (&H80)
    DT_NOCLIP               =     256 (&H100)
    DT_EXTERNALLEADING      =     512 (&H200)
    DT_CALCRECT             =    1024 (&H400)
    DT_NOPREFIX             =    2048 (&H800)
    DT_INTERNAL             =    4096 (&H1000)
    DT_EDITCONTROL          =    8192 (&H2000)
    DT_PATH_ELLIPSIS        =   16384 (&H4000)
    DT_END_ELLIPSIS         =   32768 (&H8000)
    DT_MODIFYSTRING         =   65536 (&H10000)
    DT_RTLREADING           =  131072 (&H20000)
    DT_WORD_ELLIPSIS        =  262144 (&H40000)
    DT_NOFULLWIDTHCHARBREAK =  524288 (&H80000)
    DT_HIDEPREFIX           = 1048576 (&H100000)
    DT_PREFIXONLY           = 2097152 (&H200000)End Enum

Constants

DT_LEFT
Aligns text to the left.
DT_TOP
Top-justifies text (single line only).
DT_CENTER
Centers text horizontally in the rectangle.
DT_RIGHT
Aligns text to the right.
DT_VCENTER
Centers text vertically (single line only).
DT_BOTTOM
Justifies text to the bottom of the rectangle. This value must be combined with DT_SINGLELINE.
DT_WORDBREAK
Breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the DestRect parameter. A carriage return/line feed sequence also breaks the line.
DT_SINGLELINE
Displays text on a single line only. Carriage returns and line feeds do not break the line.
DT_EXPANDTABS
Expands tab characters. The default number of characters per tab is eight. The DT_WORD_ELLIPSIS, DT_PATH_ELLIPSIS, and DT_END_ELLIPSIS values cannot be used with the DT_EXPANDTABS value.
DT_TABSTOP
Sets tab stops. Bits 15–8 (high-order byte of the low-order word) of the Format parameter specify the number of characters for each tab. The default number of characters per tab is eight. The DT_CALCRECT, DT_EXTERNALLEADING, DT_INTERNAL, DT_NOCLIP, and DT_NOPREFIX values cannot be used with the DT_TABSTOP value.
DT_NOCLIP
Draws without clipping. DrawTextW is somewhat faster when DT_NOCLIP is used.
DT_EXTERNALLEADING
Includes the font external leading in line height. Normally, external leading is not included in the height of a line of text.
DT_CALCRECT
Determines the width and height of the rectangle. If there are multiple lines of text, DrawTextW uses the width of the rectangle pointed to by the SrcRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawTextW modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawTextW returns the height of the formatted text but does not draw the text.
DT_NOPREFIX
Turns off processing of prefix characters. Normally, DrawTextW interprets the mnemonic-prefix character ampersand (&) as a directive to underscore the character that follows, and the mnemonic-prefix characters && as a directive to print a single &. By specifying DT_NOPREFIX, this processing is turned off. Compare with DT_HIDEPREFIX and DT_PREFIXONLY.
DT_INTERNAL
Uses the system font to calculate text metrics.
DT_EDITCONTROL
Duplicates the text-displaying characteristics of a multiline edit control. Specifically, the average character width is calculated in the same manner as for an edit control, and the function does not display a partially visible last line.
DT_END_ELLIPSIS or DT_PATH_ELLIPSIS
Truncates the string without adding ellipses so that the result fits in the specified rectangle. The string is not modified unless the DT_MODIFYSTRING flag is specified.

Specify DT_END_ELLIPSIS to truncate characters at the end of the string, or DT_PATH_ELLIPSIS to truncate characters in the middle of the string. If the string contains backslash (\) characters, DT_PATH_ELLIPSIS preserves as much of the text as possible after the last backslash.

DT_MODIFYSTRING
Modifies the string to match the displayed text. This flag has no effect unless the DT_END_ELLIPSIS or DT_PATH_ELLIPSIS flag is specified.
DT_RTLREADING
Displays text in right-to-left reading order for bi-directional text when a Hebrew or Arabic font is selected. The default reading order for all text is left-to-right.
DT_WORD_ELLIPSIS
Truncates text that does not fit in the rectangle and adds ellipses.
DT_NOFULLWIDTHCHARBREAK
Microsoft® Windows® 98, Windows 2000: Prevents a line break at a DBCS (double-wide character string), so that the line breaking rule is equivalent to an SBCS (single-wide character string)strings. For example, this can be used in Korean windows to increase the readability of icon labels. This is only effective if DT_WORDBREAK is specified.
DT_HIDEPREFIX
Windows 2000: Ignores the ampersand (&) prefix character in the text. The letter that follows is not underlined, but other mnemonic-prefix characters are still processed.

Example:

input string: "A&bc&&d"

normal: "Abc&d"

HIDEPREFIX: "Abc&d"

Compare with DT_NOPREFIX and DT_PREFIXONLY.

DT_PREFIXONLY
Windows 2000: Draws only an underline at the position of the character following the ampersand (&) prefix character. Does not draw any character in the string.

Example:

input string: "A&bc&&d"

normal: "Abc&d"

PREFIXONLY: " "

Compare with DT_NOPREFIX and DT_HIDEPREFIX.

See Also

D3DX8.DrawText