public override void DrawFrameBackground(Cairo.Context cr, Gdk.Rectangle alloc, Cairo.Color color, Cairo.Pattern pattern) { if (!IsPanelWidget) { base.DrawFrameBackground(cr, alloc, color, pattern); } }
/// <summary> /// Exports the specified <see cref="PlotModel" /> to a png file. /// </summary> /// <param name="model">The model.</param> /// <param name="fileName">Name of the output file.</param> /// <param name="width">The width.</param> /// <param name="height">The height.</param> /// <param name="background">The background color.</param> public static void Export(IPlotModel model, string fileName, int width, int height, Pattern background = null) { using (var bm = new ImageSurface(Format.ARGB32, width, height)) { using (var g = new Context(bm)) { if (background != null) { g.Save(); g.SetSource(background); g.Rectangle(0, 0, width, height); g.Fill(); g.Restore(); } var rc = new GraphicsRenderContext { RendersToScreen = false }; rc.SetGraphicsTarget(g); model.Update(true); model.Render(rc, width, height); bm.WriteToPng(fileName); } } }
public void SetSource(Pattern source) { CheckDisposed (); NativeMethods.cairo_set_source (handle, source.Handle); }
public void Mask(Pattern pattern) { CheckDisposed (); NativeMethods.cairo_mask (handle, pattern.Handle); }
public Pattern PopGroup() { return(Pattern.Lookup(NativeMethods.cairo_pop_group(handle), true)); }
public void SetSource(Pattern source) { NativeMethods.cairo_set_source (handle, source.Handle); }
public void DrawFrameBackground(Cairo.Context cr, Gdk.Rectangle alloc, Cairo.Pattern pattern) { DrawFrameBackground(cr, alloc, black, pattern); }
public void Mask (Pattern pattern) { CairoAPI.cairo_mask (state, pattern.Pointer); }
public void SetPattern (Pattern pattern) { CairoAPI.cairo_set_pattern (state, pattern.Pointer); }
/// <summary> /// The Pattern property is now deprecated in favour of the SetSource (pattern) method, /// but that method doesn't exist in older versions of Mono.Cairo. This extension method /// provides an implementation of that functionality. /// /// This can be removed once we port to GTK3. /// </summary> public static void SetSource (this Context g, Pattern source) { #pragma warning disable 612 cairo_set_source (g.Handle, source.Pointer); #pragma warning restore 612 }
public static Rectangle FillRectangle (this Context g, Rectangle r, Pattern pattern, PointD patternOffset) { g.Save (); g.MoveTo (r.X, r.Y); g.LineTo (r.X + r.Width, r.Y); g.LineTo (r.X + r.Width, r.Y + r.Height); g.LineTo (r.X, r.Y + r.Height); g.LineTo (r.X, r.Y); pattern.Matrix.Translate (-patternOffset.X, -patternOffset.Y); g.SetSource (pattern); Rectangle dirty = g.FixedStrokeExtents (); g.Fill (); g.Restore (); return dirty; }
public override void DrawFrameBackground(Cairo.Context cr, Gdk.Rectangle alloc, Cairo.Color color, Cairo.Pattern pattern) { // Hack to only render the black background for now playing if (pattern == null && color.R != 0 && color.G != 0 && color.B != 0) { return; } color.A = Context.FillAlpha; if (pattern != null) { cr.SetSource(pattern); } else { cr.SetSourceColor(color); } cr.Rectangle(alloc.X, alloc.Y, alloc.Width, alloc.Height); cr.Fill(); }
public Pattern PopGroup() { CheckDisposed(); return(Pattern.Lookup(NativeMethods.cairo_pop_group(handle), true)); }
public void Mask(Pattern pattern) { CheckDisposed(); NativeMethods.cairo_mask(handle, pattern.Handle); }
public void SetSource(Pattern source) { CheckDisposed(); NativeMethods.cairo_set_source(handle, source.Handle); }
protected virtual void Dispose(bool disposing) { if (disposed) return; disposed = true; if (disposing) { // free managed resources if (mask != null) { mask.Dispose (); mask = null; } if (blur != null) { blur.Dispose (); blur = null; } } // free unmanaged resources }
public static void SetFill(this Context ctx, Pattern pattern) { ctx.Pattern = pattern; }
void ShowImage(DataImageSurface imageToShow) { using(Cairo.Context context = Gdk.CairoHelper.Create(this.GdkWindow)) { Pattern pattern = new Pattern (imageToShow); context.Source = pattern; context.Paint (); ((IDisposable)pattern).Dispose (); } }
public override void DrawFrameBackground(Cairo.Context cr, Gdk.Rectangle alloc, Cairo.Color color, Cairo.Pattern pattern) { color.A = Context.FillAlpha; if (pattern != null) { cr.SetSource(pattern); } else { cr.SetSourceColor(color); } CairoExtensions.RoundedRectangle(cr, alloc.X, alloc.Y, alloc.Width, alloc.Height, Context.Radius, CairoCorners.All); cr.Fill(); }
private Pattern RenderBar (int w, int h) { ImageSurface s = new ImageSurface (Format.Argb32, w, h); Context cr = new Context (s); RenderBar (cr, w, h, h / 2); // TODO Implement the new ctor - see http://bugzilla.gnome.org/show_bug.cgi?id=561394 #pragma warning disable 0618 Pattern pattern = new Pattern (s); #pragma warning restore 0618 s.Dispose (); ((IDisposable)cr).Dispose (); return pattern; }
public abstract void DrawFrameBackground(Cairo.Context cr, Gdk.Rectangle alloc, Cairo.Color color, Cairo.Pattern pattern);
public static Rectangle FillRectangleInUnit(this Context g, Rectangle inputRect, Pattern pattern) { return FillRectangle(g,new Rectangle(inputRect.X * UnitMultiplier, inputRect.Y* UnitMultiplier, inputRect.Width* UnitMultiplier, inputRect.Height* UnitMultiplier),pattern); }
public void Mask(Pattern pattern) { NativeMethods.cairo_mask (handle, pattern.Handle); }
public void Mask (Pattern pattern) { NativeMethods.cairo_mask (state, pattern.Pointer); }
public static Rectangle FillRectangle(this Context g, Rectangle r, Pattern pattern) { g.Save (); g.MoveTo (r.X, r.Y); g.LineTo (r.X + r.Width, r.Y); g.LineTo (r.X + r.Width, r.Y + r.Height); g.LineTo (r.X, r.Y + r.Height); g.LineTo (r.X, r.Y); g.Pattern = pattern; Rectangle dirty = g.StrokeExtents (); g.Fill (); g.Restore (); return dirty; }
public void SetSource(Pattern source) { NativeMethods.cairo_set_source(handle, source.Handle); }