Note that there are some explanatory texts on larger screens.

plurals
  1. POFastest API for rendering text in Windows Forms?
    text
    copied!<p>We need to optimize the text rendering for a C# <a href="http://en.wikipedia.org/wiki/Windows_Forms" rel="noreferrer">Windows Forms</a> application displaying a large number of small strings in an irregular grid. At any time there can be well over 5000 cells visible that update 4 times per second. The font family and size is consistent across the cells, though the color may vary from cell to cell, as will bold/italic/plain.</p> <p>I've seen conflicting information on the web about <code>TextRenderer.DrawText</code> vs. <code>Graphics.DrawString</code> being the fastest/best, which reduces to a <a href="http://en.wikipedia.org/wiki/Graphics_Device_Interface" rel="noreferrer">GDI</a> vs. <a href="http://en.wikipedia.org/wiki/Graphics_Device_Interface#GDI.2B" rel="noreferrer">GDI+</a> comparison at the <a href="http://en.wikipedia.org/wiki/Windows_API" rel="noreferrer">Win32</a> level. </p> <p>I've also seen radically different results on Windows XP vs. Windows Vista, but my main target is Windows XP. Articles promising great advances under <a href="http://en.wikipedia.org/wiki/.NET_Framework_3.0#.NET_Framework_3.0" rel="noreferrer">WinFX</a> and <a href="http://en.wikipedia.org/wiki/DirectX#DirectX_10" rel="noreferrer">DirectX 10</a> aren't helpful here :-)</p> <p>What's the best approach here? I'm not afraid of introducing a small C++/CLI layer and optimizing device context handling to squeeze out more performance, but I'd like some definitive advice about which direction to take.</p> <p>EDIT: Thanks for the initial responses. I'll be trying a combination of background bitmap rendering and sticking with the GDI equivalent calls.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload