Fix message
[mono.git] / mcs / class / Mono.Cairo / Mono.Cairo / ImageSurface.cs
index 41ece1690afc6b98e5031a80abbfb375bfcb5c76..0fe99a600898925f920fb484bf85f1151dc2b4cd 100644 (file)
 //
 
 using System;
+using System.Runtime.InteropServices;
 
 namespace Cairo {
 
         public class ImageSurface : Surface
         {
+               internal ImageSurface (IntPtr handle, bool owns) : base (handle, owns)
+               {
+               }
+
                public ImageSurface (Format format, int width, int height)
                {
                        surface = CairoAPI.cairo_image_surface_create (format, width, height);
@@ -70,5 +75,24 @@ namespace Cairo {
                        get { return CairoAPI.cairo_image_surface_get_height (surface); }
                }
                
+#if CAIRO_1_2
+               public byte[] Data {
+                       get {
+                               IntPtr ptr = CairoAPI.cairo_image_surface_get_data (surface);
+                               int length = Height * Stride;
+                               byte[] data = new byte[length];
+                               Marshal.Copy (ptr, data, 0, length);
+                               return data;
+                       }
+               }
+
+               public Format Format {
+                       get { return CairoAPI.cairo_image_surface_get_format (surface); }
+               }
+
+               public int Stride {
+                       get { return CairoAPI.cairo_image_surface_get_stride (surface); }
+               }
+#endif
        }
 }