Originally posted by: c# sucks
c# sucks
ReplyOriginally posted by: Kenton Brown
The example code is faulty.
The last two radio buttons call the same code. The DrawOffScreen() routine is never called which was the point of the demo. The zip file is also confusing as there is a zip inside the zip of another demo which is the same faulty demo already provided.
private void radioButton2_CheckedChanged(object sender, System.EventArgs e)
{
InitForBitBltDrawing();
}
private void radioButton3_CheckedChanged(object sender, System.EventArgs e)
{
InitForBitBltDrawing();
}
Originally posted by: Stephen Fogarasi
My concern using Managed vs not managed is always performance.
Have you a notion about whether the "new" .NET way is faster, slower, or about the same as the "old" way ?
ReplyOriginally posted by: Rehan Nadeem
In order to use ControlStyles.DoubleBuffer efficiently, one
this.SetStyle(ControlStyles.DoubleBuffer, true);
And now what ever drawing you do in OnPaint will use double
C# also provides another way to avoid flicker and that is
to use ControlStyles.DoubleBuffer for your control/form
drawing. Following paragraph describes how to use it.
should also set ControlStyles.AllPaintingInWmPaint and
ControlStyles.UserPaint to true, this will redirect all
sort of drawing events to your OnPaint event handler.
Specially it will bypass the WM_ERASEBKGND messages. So in
your Form's OnLoad event handler, write this code
this.SetStyle(ControlStyles.AllPaintingInWmPaint , true);
this.SetStyle(ControlStyles.UserPaint, true);
buffering and there will be no flicker.
I added the above mentioned line in my form's constructor and it really worked fine........But when i tried to scroll(axis scroll of my graph) my graph still flickers, any help ???? I am desperetely seeking the solution.... Thanks in advance Sudhir
Reply