theory
Member
From: Suomi
|
posted 2004-05-08 08:48:27 |
Reply -Delete |
Built-in DOTNET double buffering is suxx. No, you do not need GetHdc.
Instead, you need a bitmap object.
First, add a bitmap object to your class
private Bitmap m_bmp;
Then create it in Form_Load (make sute it fit to your panel)
m_bmp=new Bitmap(panel_width,panel_height);
then in panel_Paint
Graphics g=e.Graphics;
Graphics gm=Graphics.FromImage(m_bmp);
gm.Clear(Color.White); // or whatever your background is
gm.FillRectangle(Brushes.black,my_rect); // make your drawing here
g.DrawImageUnscaled(m_bmp,0,0);
gm.Dispose();
| |