【zt】DrawText如何换行
1个回答
展开全部
例如如果输入一连串英文字符,那么它会当做一个单词来处理,而不会自动换行。而对于中文字符则可以。如果要对所有字符都可以像Edit控件中那样自动换行,那么可以使用DT_WORDBREAK | DT_EDITCONTROL DT_EDITCONTROLDuplicates the text-displaying characteristics of a multiline edit control. Specifically, the average character width is calculated in the same manner as for an edit control, and the function does not display a partially visible last line.(2)DT_CALRECT的使用对于一段text,要计算他的显示大小,那么可以使用DT_CALRECT标志。其中的rect参数属于IN/OUT类型。输出时,左上角坐标不变,右下角坐标改变。函数返回值是文本的高度。当然,它要与不同格式标志一起使用得到的结果是不一样的。DT_CALCRECT Determines the width and height of the rectangle. If there are multiple lines of text, DrawText will use the width of the rectangle pointed to by lpRect and extend the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText will modify 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
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询