public class ImageSurface : Surface
{
+ public ImageSurface (Format format, int width, int height)
+ {
+ surface = CairoAPI.cairo_image_surface_create (format, width, height);
+ lock (surfaces.SyncRoot){
+ surfaces [surface] = this;
+ }
+ }
+
+ public ImageSurface (string data, Cairo.Format format, int width, int height, int stride)
+ {
+ surface = CairoAPI.cairo_image_surface_create_for_data (data, format, width, height, stride);
+ lock (surfaces.SyncRoot){
+ surfaces [surface] = this;
+ }
+ }
public ImageSurface (string filename)
{
internal IntPtr surface = IntPtr.Zero;
protected Surface()
- {}
+ {
+ Console.WriteLine (Environment.StackTrace);
+ }
private Surface (IntPtr ptr, bool owns)
{
}
}
+ [Obsolete ("Use an ImageSurface constructor instead.")]
public static Cairo.Surface CreateForImage (
string data, Cairo.Format format, int width, int height, int stride)
{
return new Cairo.Surface (p, true);
}
+ [Obsolete ("Use an ImageSurface constructor instead.")]
public static Cairo.Surface CreateForImage (
Cairo.Format format, int width, int height)
{
{
if (surface == (IntPtr) 0)
return;
- lock (surfaces.SyncRoot){
+
+ lock (surfaces.SyncRoot)
surfaces.Remove (surface);
- }
+
CairoAPI.cairo_surface_destroy (surface);
surface = (IntPtr) 0;
}
}
public IntPtr Handle {
- get { return surface; }
+ get {
+ return surface;
+ }
}
public PointD DeviceOffset {
- set { CairoAPI.cairo_surface_set_device_offset (surface,
- value.X,
- value.Y);
+ set {
+ CairoAPI.cairo_surface_set_device_offset (surface, value.X, value.Y);
}
}
}
public IntPtr Pointer {
- get { return surface; }
+ get {
+ return surface;
+ }
}
-
- public Status Status {
- get { return CairoAPI.cairo_surface_status (surface); }
- }
+
+ public Status Status {
+ get { return CairoAPI.cairo_surface_status (surface); }
+ }
}
}