public Cairo.Surface CreateSimilar( Cairo.Content content, int width, int height) { IntPtr p = NativeMethods.cairo_surface_create_similar ( this.Handle, content, width, height); return new Cairo.Surface (p, true); }
public ImageInfo(ImageInfo info, Widget w, Gdk.Rectangle bounds) { Cairo.Surface similar = CairoUtils.CreateSurface(w.GdkWindow); Bounds = bounds; Surface = similar.CreateSimilar(Content.ColorAlpha, Bounds.Width, Bounds.Height); Context ctx = new Context(Surface); ctx.Matrix = info.Fill(Bounds); Pattern p = new SurfacePattern(info.Surface); ctx.Source = p; ctx.Paint(); ((IDisposable)ctx).Dispose(); p.Destroy(); }