开发者

how to find width of font?

开发者 https://www.devze.com 2023-01-31 11:07 出处:网络
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.

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

精彩评论

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