1
2
3
4
5
6
7 using System;
8
9 namespace System.Windows
10 {
11 public class Buffer
12 {
13 public Buffer(const Size& size_, System.Windows.Graphics& graphics_) :
14 size(size_), bitmap(size.w, size.h, graphics_), graphics(System.Windows.Graphics.FromImage(bitmap))
15 {
16 }
17 public inline nothrow const Size& GetSize() const
18 {
19 return size;
20 }
21 public inline nothrow System.Windows.Graphics& BitmapGraphics()
22 {
23 return graphics;
24 }
25 public inline nothrow System.Windows.Bitmap& GetBitmap() const
26 {
27 return bitmap;
28 }
29 public void Draw(System.Windows.Graphics& graphics)
30 {
31 PointF topLeftCorner;
32 graphics.DrawImageChecked(bitmap, topLeftCorner);
33 }
34 private Size size;
35 private Bitmap bitmap;
36 private System.Windows.Graphics graphics;
37 }
38 }