Double Buffering in PictureBox

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
 
K

Ken Tucker [MVP]

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
 
T

Tyson Ackland

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

Bob Powell [MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top