calculate Text rectangle

 
关于DT_CALCRECT
Determines the width and height of the rectangle. If there are multiple lines of text, DrawText uses the width of the rectangle pointed to by the lpRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawText returns the height of the formatted text but does not draw the text.
例如:
pDCMem->DrawText(strText, m_rectTextOut, DT_CALCRECT); // Calc Text Rect
 

你可能感兴趣的:(calculate Text rectangle)