We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DrawString (GDI+) -> TextOut (GDI)

Thread ID:





3754 Apr 6,2003 03:03 PM UTC Apr 8,2003 05:06 PM UTC WinForms 2
Tags: GridControl
Patrick van der Plas
Asked On April 6, 2003 03:03 PM UTC

The DrawString from GDI+ is still a rather slow operation for drawing some simple text (like the text in a grid cell). I did a test using the GDI text functions (dllimported into .net). Turns out it's about 3 times faster than using DrawString (not using any fancy DrawString features like antialiasing and stuff). Does anyone know if Microsoft will make any optimizations in this area? If not, does Syncfusion consider using the old GDI for text drawing optimization? Is it possible to build a custom cell type which draws it's text using gdi instead of gdi+ without to much effort? TIA

Administrator [Syncfusion]
Replied On April 8, 2003 12:54 AM UTC

Hi Patrick, DrawString does a bit more stuff than TextOut. A better comparison would be to compare it with DrawText GDI fn because this one also does clipping, word break etc. You should be able to derive your own cell renderer and draw text using GDI functions but I don't think it is worth the effort. You will not gain much. The reason is that the time the grid spends doing DrawString is only a small percentage during the paint mechanism. Therefore, even if you have a routine that is faster than DrawString there are still other operations like drawing background, drawing grid lines, calculating layout and cell information. GDI+ routines should become faster once there is better driver and hardware support from video cards, but I am not sure here what future plans are. Stefan

Patrick van der Plas
Replied On April 8, 2003 05:06 PM UTC

You're right...I constructed an extremely disfunctional grid myself today (only painting cells with lines and text). Just to compare the drawing speed using GDI+ for background/line painting, and GDI (DrawText) for text. The painting of the background (FillRectangle) and lines slows it down extremely, being much slower than painting all the text using DrawText (GDI). Using GDI+ for text aswell it slowed down again by factor X ( >2 ), making it just a bit faster than Syncfusion.Grid @ fullscreen (must be well designed considering my grid has close to zero logic ;-). I sincerely hope Microsoft has some 'masterplan' about GDI+. Just have to wait how it will unfold, like you, I guess...Thread.Abort();


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon