 |
GetTextExtentPoint32 ..msdn Add comment W32 Constants Translate this page |
 |
 |
|
The GetTextExtentPoint32 function computes the width and height of the specified string of text. |
 |
 |
| Code examples: |
 |
|
|
 |
 |
| Declaration: |
 |
 |
BOOL GetTextExtentPoint32(
HDC hdc, // handle to DC
LPCTSTR lpString, // text string
int cbString, // characters in string
LPSIZE lpSize // string size
);
|
 |
 |
 |
| FoxPro declaration: |
 |
 |
DECLARE INTEGER GetTextExtentPoint32 IN gdi32;
INTEGER hdc,;
STRING lpString,;
INTEGER cbString,;
STRING @ lpSize
|
 |
 |
 |
| Parameters: |
 |
hdc
[in] Handle to the device context.
lpString
[in] Pointer to a buffer that specifies the text string.
cbString
[in] Specifies the length of the lpString buffer. For the ANSI function it is a BYTE count and for the Unicode function it is a WORD count.
lpSize
[out] Pointer to a SIZE structure that receives the dimensions of the string, in logical units. |
 |
 |
| Return value: |
 |
| If the function succeeds, the return value is nonzero. |
 |
 |
| Usage: |
 |
cBuffer = REPLICATE(CHR(0), 8)
= GetTextExtentPoint32(hDC, cText,;
LEN(cText), @cBuffer)
nTextWidth = buf2dword(SUBSTR(cBuffer, 1,4))
nTextHeight = buf2dword(SUBSTR(cBuffer, 5,4))
|
 |
 |
| My comment: |
 |
The string does not need to be zero-terminated, because the cbString parameter specifies the length of the string.
See also: GdipMeasureString, FONTMETRICS(), TXTWIDTH(), WFONT( ) |
 |
 |
| Word Index links for the GetTextExtentPoint32 : |
 |
|
|
 |
 |
| Translate this page: |
 |
|
 |
 |
| • |
 |
| Created: | 2003-09-18 10:02:24 | | Modified: | 2007-06-11 16:12:51 | Visited in last 7 days: 192 |