public static XlibSurface FromBitmap(IntPtr display, IntPtr bitmap, IntPtr screen, int width, int height) { IntPtr ptr; ptr = CairoAPI.cairo_xlib_surface_create_for_bitmap(display, bitmap, screen, width, height); return(new XlibSurface(ptr, true)); }
public PdfSurface(string filename, double width, double height) { surface = CairoAPI.cairo_pdf_surface_create(filename, width, height); lock (surfaces.SyncRoot){ surfaces [surface] = this; } }
public Rectangle FillExtents() { double x1, y1, x2, y2; CairoAPI.cairo_fill_extents(state, out x1, out y1, out x2, out y2); return(new Rectangle(x1, y1, x2, y2)); }
public TextExtents TextExtents(string utf8) { TextExtents extents = new TextExtents(); CairoAPI.cairo_text_extents(state, utf8, ref extents); return(extents); }
public Rectangle StrokeExtents() { double x1, y1, x2, y2; CairoAPI.cairo_stroke_extents(state, out x1, out y1, out x2, out y2); return(new Rectangle(x1, y1, x2, y2)); }
public RadialGradient(double cx0, double cy0, double radius0, double cx1, double cy1, double radius1) : base() { pattern = CairoAPI.cairo_pattern_create_radial(cx0, cy0, radius0, cx1, cy1, radius1); }
public static Matrix Multiply(Matrix a, Matrix b) { Matrix result = new Matrix(); CairoAPI.cairo_matrix_multiply(result, a, b); return(result); }
public ImageSurface(byte *data, Cairo.Format format, int width, int height, int stride) { surface = CairoAPI.cairo_image_surface_create_for_data(data, (int)format, width, height, stride); lock (surfaces.SyncRoot) { surfaces[surface] = this; } }
public ImageSurface(Format format, int width, int height) { surface = CairoAPI.cairo_image_surface_create(format, width, height); lock (surfaces.SyncRoot) { surfaces[surface] = this; } }
public Cairo.Surface CreateSimilar( Cairo.Content content, int width, int height) { IntPtr p = CairoAPI.cairo_surface_create_similar( this.Handle, content, width, height); return(new Cairo.Surface(p, true)); }
public void Merge(FontOptions other) { if (other == null) { throw new ArgumentNullException("other"); } CairoAPI.cairo_font_options_merge(handle, other.Handle); }
public XlibSurface(IntPtr display, IntPtr drawable, IntPtr visual, int width, int height) { surface = CairoAPI.cairo_xlib_surface_create(display, drawable, visual, width, height); lock (surfaces.SyncRoot) { surfaces[surface] = this; } }
public Win32Surface(IntPtr hdc) { surface = CairoAPI.cairo_win32_surface_create(hdc); lock (surfaces.SyncRoot) { surfaces[surface] = this; } }
public ImageSurface(string filename) { surface = CairoAPI.cairo_image_surface_create_from_png(filename); lock (surfaces.SyncRoot) { surfaces[surface] = this; } }
public void GlyphPath(Matrix matrix, Glyph[] glyphs) { IntPtr ptr; ptr = FromGlyphToUnManagedMemory(glyphs); CairoAPI.cairo_glyph_path(state, ptr, glyphs.Length); Marshal.FreeHGlobal(ptr); }
public void InitRotate(double radians) { /* * double s, c; * s = Math.Sin (radians); * c = Math.Cos (radians); * this.Init (c, s, -s, c, 0, 0); */ CairoAPI.cairo_matrix_init_rotate(this, radians); }
public SolidPattern(Color color, bool solid) { if (solid) { pattern = CairoAPI.cairo_pattern_create_rgb(color.R, color.G, color.B); } else { pattern = CairoAPI.cairo_pattern_create_rgba(color.R, color.G, color.B, color.A); } }
protected Surface(IntPtr ptr, bool owns) { surface = ptr; lock (surfaces.SyncRoot) { surfaces[ptr] = this; } if (!owns) { CairoAPI.cairo_surface_reference(ptr); } }
protected virtual void Dispose(bool disposing) { if (surface == (IntPtr)0) { return; } lock (surfaces.SyncRoot) surfaces.Remove(surface); CairoAPI.cairo_surface_destroy(surface); surface = (IntPtr)0; }
protected virtual void Dispose(bool disposing) { if (!disposing) { //Console.WriteLine ("Cairo.Context: called from thread"); return; } if (state == IntPtr.Zero) { return; } //Console.WriteLine ("Destroying"); CairoAPI.cairo_destroy(state); state = IntPtr.Zero; }
public SurfacePattern(Surface surface) { pattern = CairoAPI.cairo_pattern_create_for_surface(surface.Handle); }
public Status AddColorStopRgb(double offset, Cairo.Color c) { CairoAPI.cairo_pattern_add_color_stop_rgb(pattern, offset, c.R, c.G, c.B); return(Status); }
public LinearGradient(double x0, double y0, double x1, double y1) : base() { pattern = CairoAPI.cairo_pattern_create_linear(x0, y0, x1, y1); }
public void Destroy() { CairoAPI.cairo_pattern_destroy(pattern); }
protected void Reference() { CairoAPI.cairo_pattern_reference(pattern); }
bool Equals(FontOptions options) { return(options != null && CairoAPI.cairo_font_options_equal(Handle, options.Handle)); }
public void Destroy() { CairoAPI.cairo_font_options_destroy(handle); }
public FontOptions Copy() { return(new FontOptions(CairoAPI.cairo_font_options_copy(handle))); }
public FontOptions() { handle = CairoAPI.cairo_font_options_create(); }
public override int GetHashCode() { return((int)CairoAPI.cairo_font_options_hash(handle)); }