How to stop jumpy drawing...

  • Thread starter Thread starter dwhittenburg
  • Start date Start date
D

dwhittenburg

Is there a way to not show anything until everything is drawn?

I thought I read somewhere on here how to do this...I just can't remember
what to search for or else I would...
 
We'll need a bit more info. What's the context? If you're drawing into a
Graphics object, then draw to an offscreen buffer, then blit the result to
the screen when you're done (commonly called double buffering).

--
Chris Tacke
Co-founder
OpenNETCF.org
Has OpenNETCF helped you? Consider donating to support us!
http://www.opennetcf.org/donate
 
Look for double buffering, if I understand your question, that is what you
want to achieve
 
I've created a square object for a calendar...When building the calendar I
draw all these squares on the screen...They are drawn one by one instead of
all at once, I just didn't know if there was a screen suspend or something
untill I'm ready to show it...

I will search for double buffering...

Thanks
 
In short -
1) create a bitmap size of your control
2) In your Paint event handler draw everyithing you need on the Graphics
object created from that bitmap (Graphics.FromImage). This Graphics object
needs to be created once and stored. You can optimize the drawing by
painting only those elements that intersect with e.ClipRect
3) when done, do this:
 
Sorry, sent too early.

In short -
1) create a bitmap size of your control (m_bmOff)
2) In your OnPaint override draw everyithing you need on the Graphics
object created from that bitmap (Graphics.FromImage). This Graphics object
needs to be created once and stored. You can optimize the drawing by
painting only those elements that intersect with e.ClipRectangle
3) when done, do this:
e.Graphics.DrawImage(m_bmOff, e.ClipRectangle, e.ClipRectangle,
GraphicsUnit.Pixel);
 
Back
Top