SRGraphTitle::GetTextDimension
CSizeSRGraphTitle::GetTextDimension(LPCTSTRtext, BOOLbWrapText, intnWrapWidth)
Calculates the logical size of a text string using the currently selected font
Defined in: SRGraphTitle.cpp
Return Value
CSize object containing the width and height of the text
Parameters
text
Pointer to the text to size
bWrapText
TRUE to enable word wrap
nWrapWidth
Width to which text is to be fit by wrapping long lines to the next line
Developer Notes
Both GetTextExtent and DrawText do not give true sizes for text. GetOutputTextExtent treats all text as a single line and so gives a width based on all the characters in the text. DrawText merely extends the height of an existing rectangle and does not give accurate information on widths. Therefore this routine finds the maximum width of all the separate lines and the height calculated from the total number of lines.