Click here to Skip to main content
15,912,837 members
Home / Discussions / C#
   

C#

 
AnswerRe: Accurate timer in C# Pin
leppie4-Nov-08 3:25
leppie4-Nov-08 3:25 
AnswerRe: Accurate timer in C# Pin
DaveyM694-Nov-08 0:27
professionalDaveyM694-Nov-08 0:27 
GeneralRe: Accurate timer in C# Pin
Luc Pattyn4-Nov-08 0:49
sitebuilderLuc Pattyn4-Nov-08 0:49 
GeneralRe: Accurate timer in C# Pin
PIEBALDconsult4-Nov-08 3:14
mvePIEBALDconsult4-Nov-08 3:14 
GeneralRe: Accurate timer in C# Pin
Luc Pattyn4-Nov-08 3:23
sitebuilderLuc Pattyn4-Nov-08 3:23 
QuestionUse Javascript in Window Application Pin
astrovirgin3-Nov-08 21:25
astrovirgin3-Nov-08 21:25 
AnswerRe: Use Javascript in Window Application Pin
Simon P Stevens3-Nov-08 23:21
Simon P Stevens3-Nov-08 23:21 
QuestionFaster text drawing in C#/.NET with GDI+? Pin
Mr. Accident3-Nov-08 20:38
Mr. Accident3-Nov-08 20:38 
I'm currently writing a custom control for use with a WinForms application - basically, it's a hex editor control, which displays offsets, rows of bytes, a text column, and some other information.

I'm doing all the drawing inside OnPaint, but I've started to notice that rendering becomes a little laggy when the control is large (and thus a lot of bytes are being drawn). In extreme cases it can take around 20 to 30 milliseconds to draw the entire control. This isn't terrible, but it makes dragging selections feel very slightly sluggish, and I'm sure it's much worse on lower-end machines.

The control is entirely text based - aside from a couple Graphics.DrawPath/FillPath calls, the bulk of the GDI+ calls are to Graphics.DrawString (one for each byte displayed, to allow for custom column spacing). These DrawString calls end up taking up the vast majority of the rendering time.

Is there any faster way to do text drawing in GDI+? It seems that it would be a good move to try to reduce the number of DrawString calls, but how can I do that while still maintaining control over the spacing of characters?

Perhaps there's another, simpler way of rendering text for this purpose that I'm just unaware of? Any advice would be appreciated.
GeneralRe: Faster text drawing in C#/.NET with GDI+? Pin
Guffa3-Nov-08 21:01
Guffa3-Nov-08 21:01 
GeneralRe: Faster text drawing in C#/.NET with GDI+? Pin
Mr. Accident4-Nov-08 12:00
Mr. Accident4-Nov-08 12:00 
AnswerRe: Faster text drawing in C#/.NET with GDI+? Pin
leppie3-Nov-08 21:37
leppie3-Nov-08 21:37 
QuestionRe: Faster text drawing in C#/.NET with GDI+? Pin
Mr. Accident4-Nov-08 12:11
Mr. Accident4-Nov-08 12:11 
AnswerRe: Faster text drawing in C#/.NET with GDI+? Pin
leppie3-Nov-08 21:38
leppie3-Nov-08 21:38 
GeneralRe: Faster text drawing in C#/.NET with GDI+? Pin
Luc Pattyn4-Nov-08 0:55
sitebuilderLuc Pattyn4-Nov-08 0:55 
Questionhow to launch an application associated to a file of a certain extension? (say .avi) Pin
swjam3-Nov-08 20:03
swjam3-Nov-08 20:03 
AnswerRe: how to launch an application associated to a file of a certain extension? (say .avi) Pin
Giorgi Dalakishvili3-Nov-08 20:24
mentorGiorgi Dalakishvili3-Nov-08 20:24 
QuestionForm in C# Pin
dec823-Nov-08 19:24
dec823-Nov-08 19:24 
AnswerRe: Form in C# Pin
Giorgi Dalakishvili3-Nov-08 19:45
mentorGiorgi Dalakishvili3-Nov-08 19:45 
QuestionRe: Form in C# Pin
nelsonpaixao4-Nov-08 13:26
nelsonpaixao4-Nov-08 13:26 
Questionproblem with binding a datasource to textbox Pin
prasadbuddhika3-Nov-08 19:01
prasadbuddhika3-Nov-08 19:01 
AnswerRe: problem with binding a datasource to textbox Pin
prasadbuddhika3-Nov-08 22:21
prasadbuddhika3-Nov-08 22:21 
QuestionSetup problem Pin
sumit70343-Nov-08 18:22
sumit70343-Nov-08 18:22 
AnswerRe: Setup problem Pin
dan!sh 3-Nov-08 18:38
professional dan!sh 3-Nov-08 18:38 
GeneralRe: Setup problem Pin
sumit70343-Nov-08 18:52
sumit70343-Nov-08 18:52 
GeneralRe: Setup problem Pin
dan!sh 3-Nov-08 19:04
professional dan!sh 3-Nov-08 19:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.