Graphics and Double Buffering

S

Simon Jefferies

Hello,

I am using the Paint event to draw graphics, but I am getting annoying flickering. Is there anyway to perform double-buffering?

I have looked at creating a bitmap, but is limited in what I can do with it.

Any ideas?

Thanks
Simon Jefferies
(e-mail address removed)
 
J

Jay B. Harlow [MVP - Outlook]

Simon,
Include the following in your Form or Control's constructor.

' Stop the flicker
Me.SetStyle(ControlStyles.UserPaint, True)
Me.SetStyle(ControlStyles.DoubleBuffer, True)
Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)
Me.SetStyle(ControlStyles.ResizeRedraw, True)
Me.UpdateStyles()

This needs to be in the class you are painting ON, which can be different
then the object where the paint handler is. I normally handle the Paint
event in the same class that I am painting on.

Hope this helps
Jay

Hello,

I am using the Paint event to draw graphics, but I am getting annoying
flickering. Is there anyway to perform double-buffering?

I have looked at creating a bitmap, but is limited in what I can do with it.

Any ideas?

Thanks
Simon Jefferies
(e-mail address removed)
 
A

Armin Zingler

Simon Jefferies said:
I am using the Paint event to draw graphics, but I am getting
annoying flickering. Is there anyway to perform double-buffering?

I have looked at creating a bitmap, but is limited in what I can do
with it.

Any ideas?

Maybe somebody at
microsoft.public.dotnet.framework.drawing
can help you.
 

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