开发者

LPD3DXFONT DrawText using DT_CALCRECT?

开发者 https://www.devze.com 2022-12-10 02:59 出处:网络
How do I use DT_CALCRECT to determine my rectangle bottom and right coords? e.g I have this rect: RECT textPos;

How do I use DT_CALCRECT to determine my rectangle bottom and right coords? e.g I have this rect: RECT textPos; textPos.left = 100; textPos.right = 100;

What do I 开发者_运维问答do next to calculate the rect and draw the text?


Mmm you just make a call to DrawText with the DT_CALCRECT parameter set, and the pointer to your original rectangle. It will modify the rectangle, extending the bottom and right values. Then you make another call to DrawText with your updated rectangle and whatever DT_ parameter needed.

http://msdn.microsoft.com/en-us/library/ms901121.aspx

0

精彩评论

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