本文介绍了计算多行字符串的文本范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我有一个多行字符串需要在具有固定宽度和可变高度的矩形区域中绘制.在矩形中绘制字符串时,如果线的长度超过区域的宽度,则超出的部分将放入新的线中.
我需要计算文本区域的边界矩形的高度.我该怎么做?
我确实检查了CDC的GetTextExtend ...()函数,但它们只允许获取单行字符串的范围.
请在这方面帮助我.
在此先感谢.
Quy
Hi All,
I have a multi-line string need to be drawn in a rectangular area which has fixed-width and variable height. As the string being drawn in the rectangle, if a line''s length exceeds the area''s width, the exceeding part will be put in to a new line.
What I need is to calculate height of boundary rectangle of text area. How can i do it?
I did check GetTextExtend...() functions of CDC, but they allow to get extent of SINGLE line string only.
Please help me in this regard.
Thanks in Advance.
Quy
推荐答案
这篇关于计算多行字符串的文本范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!