Using Win32 functions in Visual FoxPro Image Gallery
Font and Text
..msdn
CreateFont
DrawText
GetCharABCWidths
GetTextAlign
GetTextCharacterExtra
GetTextColor
GetTextExtentPoint32
GetTextFace
GetTextMetrics
SetTextAlign
SetTextCharacterExtra
SetTextColor
TextOut
Code examples:
Vertical Label control
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:
Vertical Label control
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:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2003-09-18 10:02:24
Modified: 2007-06-11 16:12:51
Visited in last 7 days: 37
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2014 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.1.68), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Google
Advertise here!