Double Buffering in PictureBox

  • Thread starter Thread starter TyBreaker
  • Start date Start date
T

TyBreaker

Hi, I'm planning to do some GDI animation and came across some
references to using ControlStyles in Forms to do it automatically. The
ControlStyles though seems to set Double Buffering on the Form itself -
so does this then mean the PictureBox on the Form will also be Double
Buffered in terms of flicker-free animation? If not, I'll have to do
the Double Buffering in my usual way I guess.

TyBreaker
 
Hi,

Just because the form is double buffered doesnt mean the picture box
will be flicker free. I would draw on to a bitmap then draw the bitmap on
the picturebox.

Ken
-----------------------
Hi, I'm planning to do some GDI animation and came across some
references to using ControlStyles in Forms to do it automatically. The
ControlStyles though seems to set Double Buffering on the Form itself -
so does this then mean the PictureBox on the Form will also be Double
Buffered in terms of flicker-free animation? If not, I'll have to do
the Double Buffering in my usual way I guess.

TyBreaker
 
Thanks Ken, that has been my usual approach but when I saw this built-in
double buffering I was wondering if it was addressing the same thing but
perhaps not.
 
Double buffering affects the surface of the control doing the buffering.
Other child controls such as picturebox have their own windows and require
their own buffering.

If you need a double buffered image you can write a control that just
displays a double buffered image really easily.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Back
Top