wondering a few things about speed...

Darc

Well-known member
Joined
Apr 18, 2003
Messages
89
I just was wondering a few things about the speed of and how to speed up GDI+. First, which is faster, drawing to a Form or a PictureBox (provided double buffering is enabled)? and second, should you do Draw(Control.CreateGraphics) or Control.Refresh() for triggering the paint? Thanx for any help.
 
Refresh it, creating graphics will lose the double buffering from my tests so far, example:

in a module on form load I set g (a Grapics object) by doing the this.CreateGraphics()... I also set double buffering and all of that. In my form paint anything I draw is truely buffered (when drawn with e.Graphics, whereas anything I draw with the g object isnt double buffered.

Thats my opinion.
 
If you are creating a web based application and speed is a major issue (Which normally it is) the current installment of GDI does NOT take advantage of any hardware acceleration, if my memory serves me correctly. You may want to look into a DirectX component as far as speed is concerned
 
I know DirectDraw, and this is for Windows Apps I just dont like distributing apps that need around 200 megs to run when theyre like school projects.
 
Using Control.Invalidate() is much faster than using
Control.Refresh() for triggering the painting.
 
Or, move your painting logic to a function (instead of in the event) and call the function if you determine you need to paint.

-Nerseus
 
Back
Top