开发者

C++ Outputting text on a window

开发者 https://www.devze.com 2023-04-07 18:37 出处:网络
Simple question, is drawing text using functions like TextOut or DrawText better then creating a static control, performance wise?开发者_如何学Python

Simple question, is drawing text using functions like TextOut or DrawText better then creating a static control, performance wise?

开发者_如何学Python

And which has better performance TextOut or DrawText?


Second question first: DrawText calls TextOut, so if you don't need the formatting capabilities of DrawText, you can go straight to TextOut.

If raw performance is all you care about, then drawing directly will be faster. However, raw performance should not be your sole concern. It is also more work and does not support accessibility (which means you have to write additional code to support IAccessible).


DrawText looks more powerful and flexible, possibly it makes more work. Regarding HDC drawing vs. static control: they are used for different purposes. For example, it is better to use static control in a dialog. But if you want to draw some text in a graph - dynamic text is much better.

0

精彩评论

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

关注公众号