How to measure string length in pixel
Hello,
Is it possible to know how big a piece of text will be on screen depending of the font I'm using with unmanaged DirectX? Every article on this I've found so far are in managed code.
Thanks,
-Roxanne
Assuming you're using Direct3D 9 and ID3DXFont to draw the text, then calling ID3DXFont::DrawText with DT_CALCRECT for the Format parameter will return the rectangle that will be used, as described in the docs for that function. If you're using something else, then some details would help.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement