Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a fast way to draw text in WPF

Tags:

wpf

I need to display a lot of text in my WPF window.

I am using DrawingContext.DrawText but it is too slow.

I tried DrawingContext.DrawGlyph. The call itself is faster but if you count the glyph creation, it is about the same time.

Is there a way to speed things up even it means loosing text quality?

like image 572
user380719 Avatar asked Feb 22 '11 17:02

user380719


1 Answers

Have you tried with TextBlock controls ? I put them on a Canvas, and for me it turned out to be faster than solutions involving FormattedText or DrawingContext.DrawGlyphRun().

like image 190
Jem Avatar answered Oct 04 '22 19:10

Jem