简体   繁体   中英

C++ Outputting text on a window

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM