Guest User

Untitled

a guest
Jun 17th, 2012
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. double buffered in c# [closed]
  2. Graphics g = Graphics.FromHwnd(panel.Handle);
  3. if (newImage == true)
  4. {
  5. g.Clear(SystemColors.Control);
  6. newImage = false;
  7. }
  8.  
  9. g.DrawImage(bmp, hOffset, vOffset);
  10. g.Dispose();
  11.  
  12. this.SetStyle(ControlStyles.AllPaintingInWmPaint |ControlStyles.UserPaint |ControlStyles.DoubleBuffer, true);
  13.  
  14. System.Drawing.BufferedGraphics
  15.  
  16. System.Drawing.BufferedGraphics
  17.  
  18. System.Drawing.Graphics
  19.  
  20. System.Drawing.Graphics g = this.CreateGraphics();
  21. System.Drawing.BufferedGraphicsContext dc = new BufferedGraphicsContext();
  22. BufferedGraphics backbuffer = dc.Allocate(g, new Rectangle(new Point(0, 0), g.VisibleClipBounds.Size.ToSize()));
  23. backbuffer.Graphics.DrawImage(Image.FromFile(@"c:test.jpg"), new Point(10, 10));
  24. backbuffer.Render(g);
Advertisement
Add Comment
Please, Sign In to add comment