Textout is not supported on ce, use drawtext or exttextout

Source: Internet
Author: User
Tags drawtext textout truncated

Textout is not supported on ce, use drawtext or exttextout

 

 

 

Http://www.bolingconsulting.com/progwince.htm

 

 

 

Exttextout

 

Function: draws a string using the selected font, background color, and body color. You can provide an optional rectangle for cropping or being an opacity or both. Function prototype: bool exttextout (HDC, int X, int y, uint fuoptions, const rect * LPRC, lpctstr lpstring, uint cbcount, const int * lpdx); parameter: HDC: device environment handle. X: Specifies the logical X coordinate of the benchmark used to place the string. Y: Specifies the Y coordinate used to place the string. Fuoptions: Specifies how to use the rectangle defined by the application. This parameter can be a combination of the following values. Each value indicates eto_clipped: The body is cropped to the rectangle. Eto_glyph_index: lpstring points to the array returned by getcharacterplacement. If no further special language processing is required, this array is parsed directly by GDI and only the symbol index is applied to the font, however, this flag can be used for bitmap and Vector Fonts to indicate that further language processing is not required. The GDI application directly processes this string. Eto_opaque: Fill the rectangle with the current background color. Eto_rtlreading: if this value is specified in middle_eastern windows and Hebrew or Arabic fonts are selected into the device environment, this string is used to output the reading order from right to left. If this value is not specified, the string is output from left to right. Set ta_rtlreading in settextalign to achieve the same effect. Backward compatible. This value is reserved. The values of eto_glyph_index and eto_rtlreading cannot be used together. Because eto_glyph_index indicates that all language processing has been completed, the function will ignore the specified eto_rtlreading value. Note that although the string is considered to be 8-bit data for the grating font, all the symbol indexes are 16-bit values. LPRC: a pointer to the structure rect, which contains the size used for cropping or being an opaque rectangle. Lpstring: pointer to the string to be drawn. This string does not end with/0 because cbcount specifies its length. Cbcount: specifies the number of characters in a string. Lpdx: pointer to an optional array. The value in the array indicates the distance between the start points of adjacent characters. For example, the lpdx logical unit separates the starting point of the character unit I and the character unit cell I + 1. Return Value: If the string is drawn, the return value is non-zero. If the function call fails, the return value is 0. Windows NT: To obtain more error information, call the getlasterror function. Note: The current text alignment setting of the specified device environment determines how the datum point is used to hold the text. Call the gettextalign function to obtain the text alignment settings. Call the settextalign function to change the text alignment mode. If the parameter lpdx is null, exttextout uses the default interval between characters. The starting position of the character unit and the content of the array directed by lpdx are given by the logical unit. The starting position of a character unit is defined as the upper right corner of the character unit. By default, this function does not use or change the current state. However, when the system calls the exttextout application in the specified device environment, it can call the settextalign function (set its fmode parameter to ta_updatecp) to allow the system to use and change the current state. When this flag is set, the X and Y parameters are ignored in subsequent exttextout calls. Windows CE: the following values are supported for the fuoptions parameter: eto_clipped and eto_opaque. Quick query: Windows NT: 3.1 and later; windows: 95 and later; Windows CE: 1.0 and later; header file: wingdi. h; library file: gdi32.lib; UNICODE: Unicode and ANSI are implemented in Windows NT. Drawtext {
BK. View. editlemma ("/edit/", 1023733,1); Return false
} 'Href = "http://baike.baidu.com/view/1023733.htm#"> edit this section

Function

This function writes the formatted body to the specified rectangle and formats the body (Extended tabs, character alignment, and line breaks) according to the specified method ). To specify additional formatting options, use the drawtextex function.

{
BK. View. editlemma ("/edit/", 1023733,2); Return false
} 'Href = "http://baike.baidu.com/view/1023733.htm#"> edit this section

Function prototype

Int drawtext (HDC, // device description table handle lpctstr lpstring, // The Int ncount string to be drawn, // The length of the string lprect, // The uint uformat pointer pointing to the rect of the rectangular structure // The painting option of the body );

{
BK. View. editlemma ("/edit/", 1023733,3); Return false
} 'Href = "http://baike.baidu.com/view/1023733.htm#"> edit this section

Parameters

HDC: [input] device environment handle. Lpstring: [input] pointer to the string to be written. If the ncount parameter is-1, the string must end with/0. If uformat contains dt_modifystring, the function can add four characters to the string. The buffer for storing the string must be large enough to accommodate additional characters. Ncount: [input] The number of characters in the string. If ncount is-1, the string pointed to by lpstring is considered to end with/0. drawtext automatically calculates the number of characters. Lprect: [input/output] pointer to the structure rect, which contains information about the rectangle in which the text will be placed (by logical coordinates ). Uformat: [input] specifies the method for formatting text. It can be any combination of the following values. The values are described as follows:

Value Description
Dt_bottom Adjust the body to the bottom of the rectangle. This value must be combined with dt_singleline.
Dt_calcrect Determines the width and height of the rectangle. If the body contains multiple rows, drawtext uses the width of the rectangle defined by lprect and expands the bottom of the rectangle to accommodate the last row of the body. If the body contains only one row, drawtext changes the right boundary of the rectangle to accommodate the last character of the next line. In either of the above cases, drawtext returns the height of the formatted body, rather than the body.
Dt_center Center the body horizontally in the rectangle.
Dt_vcenter Center the body vertically in the rectangle. (Dreamsmart note: this parameter must be used with dt_single; otherwise, GDI cannot calculate the destination rectangle)
Dt_editcontrol Copy the text display feature of the multi-row editing control. In particular, the average character width for editing control is calculated in the same way. This function does not display only the last partially visible line.
Dt_end_ellipsis For the displayed text, if the range of the ending string is not within the rectangle, it will be truncated and marked with an ellipsis. If a letter is not at the end of a string beyond the rectangle range, it is not truncated and marked with a ellipsis. The string is not modified unless the dt_modifystring flag is specified.
Dt_expandtabs Extended tabs. The default number of characters for each tab is 8. Dt_word_ellipsis, dt_path_ellipsis and dt_end_ellipsis cannot be used with this parameter
Dt_externalleading The height of a row contains the external header of the font. Generally, the external header is not included in the height of the body row.
Dt_hideprefix Ignore the prefix characters (&) in the body, and the letters after the prefix characters do not contain underscores. The call method of other prefix characters is not affected. Input string: "A & BC & D" Normal: "ABC & D" dt_hideprefix: "ABC & D"
Dt_internal The system font is used to calculate the body measurement.
Dt_left The text is left aligned.
Dt_modifystring Modify the given string to match the displayed body. This flag must be used together with dt_end_ellipsis or dt_path_ellipsis.
Dt_noclip No cropping. When dt_noclip is used, the use of drawtext will be accelerated.
Dt_nofullwidthcharbreak To prevent line breaking in string with wide characters, the line breaking rule is equivalent to a single character string. For example, we can use it in Windows to provide better readability for icon labels. This value does not work unless dt_wordbreak is specified.
Dt_noprefix Disable prefix character processing. Generally, drawtext is used to explain the prefix of the mnemonic character. & it is used to underline the character after it, and the description & is used to display a single &. Specify dt_noprefix, Which is disabled.
Dt_path_ellipsis For the displayed body, replace the character string in the ellipse to ensure that the result is within the appropriate rectangle. If the string contains the backslash (/) character, dt_path_ellipsis tries its best to retain the body after the last backslash. The string is not modified unless the dt_modifystring flag is specified.
Dt_prefixonly Only draw an underline at the position of the (&) prefix. No other characters in the string are drawn. Input string: "A & BC & D" Normal: "ABC & D" dt_prefixonly :"_"
Dt_right Right-aligned text.
Dt_rtlreading When the font selected for the device environment is a Hebrew or Arabic font, the order of reading from right to left for the bidirectional body is from left to right.
Dt_singleline If the same line of the text is displayed, the carriage return and line break cannot be broken.
Dt_tabstop Set tabulation. The uformat parameter's 15 "C8 bits (the high byte in the low-level word) specifies the number of characters for each tab. The default number of characters for each tab is 8. Note: dt_calcrect, dt_externalleading, dt_internal, dt_noclip, and dt_noprefix values cannot be used with dt_tabstop values.
Dt_top Align the top of the body (only for a single row ).
Dt_wordbreak Disconnect a word. When the characters in a row extend to the border of the rectangle specified by lprect, this row is automatically broken between words. A carriage return and a line feed can also break the line.
Dt_word_ellipsis Truncates the text of a rectangle and adds a ellipsis.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.