Simple question, is drawing text using functions like TextOut or DrawText better then creating a static control, performance wise?
开发者_如何学PythonAnd 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.
精彩评论