开发者

how to find width of font?

I'm using directx to draw my string开发者_Python百科, directx uses GDI to draw the string..

I'm using DrawText to draw my string. I need a way to find the width of the string.

Any idea ?


You mean this DrawText? If so, it has a DT_CALCRECT flag that allows you to calculate the size of the text to draw.


DrawText can calculate it for you. See the DT_CALCRECT flag:

http://msdn.microsoft.com/en-us/library/dd162498%28v=vs.85%29.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜