Salut Bart Broersma !
Dans un message de Bart Broersma dat‚ du 21 Apr 97 01:32:02 il ‚tait dit:
BB> How do I get the width and heigth of a given string using a
BB> given font ?
Use the GetTextExtentPoint32 API call:
BOOL GetTextExtentPoint32(
HDC hdc, // handle of device context
LPCTSTR lpString, // address of text string
int cbString, // number of characters in string
LPSIZE lpSize // address of structure for string size
);
hdc is Canvas.Handle
lpString is PChar(YourString)
cbString is Length(YourString)
lpSize is Size (var Size : TSize;)
Amiti‚s,
{-Francois Piette-}
francois.piette@ping.be
http://www.rtfm.be/fpiette
--- SvFido 1.32
---------------
* Origin: OverByte BBS (Embourg-Belgium) 32-4-3651395 VFC/V34+ (2:293/2202)
|