//
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);
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
}
}