I can't find Double Buffering support in the compact
framework when i want to draw a control.
Is this supported or do i have to write it by myself ?
If yes, are there any examples available?
Regards
Dieter De Preester
You are right, that you will need to implement double-
buffering by yourself. It could look something like that:
protected override void OnPaint(PaintEventArgs pea)
{
Graphics grfx = pea.Graphics;
Graphics offScreenGraphics;
Bitmap offscreenBitmap;
offscreenBitmap = new Bitmap
(BackgroundBitmap.Width, BackgroundBitmap.Height);
offScreenGraphics = Graphics.FromImage
(offscreenBitmap);
if (BackgroundBitmap != null)
{
offScreenGraphics.DrawImage
(BackgroundBitmap, 0, 0, BackgroundBitmap.Width,
BackgroundBitmap.Height);
}
grfx.DrawImage(offscreenBitmap, 0, 0);
}
HTH... Alex
--
Alex Yakhnin, eMVP
IntelProg, Inc.
http://www.intelprog.com
>.
>