
Untitled
By: a guest on
Jun 17th, 2012 | syntax:
None | size: 0.90 KB | hits: 21 | expires: Never
double buffered in c# [closed]
Graphics g = Graphics.FromHwnd(panel.Handle);
if (newImage == true)
{
g.Clear(SystemColors.Control);
newImage = false;
}
g.DrawImage(bmp, hOffset, vOffset);
g.Dispose();
this.SetStyle(ControlStyles.AllPaintingInWmPaint |ControlStyles.UserPaint |ControlStyles.DoubleBuffer, true);
System.Drawing.BufferedGraphics
System.Drawing.BufferedGraphics
System.Drawing.Graphics
System.Drawing.Graphics g = this.CreateGraphics();
System.Drawing.BufferedGraphicsContext dc = new BufferedGraphicsContext();
BufferedGraphics backbuffer = dc.Allocate(g, new Rectangle(new Point(0, 0), g.VisibleClipBounds.Size.ToSize()));
backbuffer.Graphics.DrawImage(Image.FromFile(@"c:test.jpg"), new Point(10, 10));
backbuffer.Render(g);