1 
 2 // =================================
 3 // Copyright (c) 2021 Seppo Laakko
 4 // Distributed under the MIT license
 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.wsize.hgraphics_)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(bitmaptopLeftCorner);
33         }
34         private Size size;
35         private Bitmap bitmap;
36         private System.Windows.Graphics graphics;
37     }
38 }