Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
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.
Posted

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 isn't double buffered.

 

That's my opinion.

Posted
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
Posted
I know DirectDraw, and this is for Windows Apps I just don't like distributing apps that need around 200 megs to run when they're like school projects.
  • *Experts*
Posted

Using Control.Invalidate() is much faster than using

Control.Refresh() for triggering the painting.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

  • *Experts*
Posted

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

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...