protected override void ClippedRender(Cairo.Context cr) { Brush brush = Background; if (!brush.IsValid) { return; } double x = Double.IsNaN(brush.Width) ? 0 : (RenderSize.Width - brush.Width) * XAlign; double y = Double.IsNaN(brush.Height) ? 0 : (RenderSize.Height - brush.Height) * YAlign; cr.Rectangle(0, 0, RenderSize.Width, RenderSize.Height); cr.ClipPreserve(); if (x != 0 || y != 0) { cr.Translate(x, y); } cr.Antialias = Cairo.Antialias.None; brush.Apply(cr); cr.Fill(); }
void drawTechBorder1 (Cairo.Context gr){ Rectangle r = ClientRectangle; double l1 = Math.Round(0.2 * Math.Min (r.Width, r.Height)) + 0.5; Foreground.SetAsSource (gr); gr.LineWidth = 6.0; gr.MoveTo (r.Left + 1.5, r.Top + l1); gr.LineTo (r.Left + 1.5, r.Top + 1.5); gr.LineTo (r.Left + l1, r.Top + 1.5); gr.MoveTo (r.Left + r.Width * 0.65, r.Bottom - 1.5); gr.LineTo (r.Left + r.Width * 0.85, r.Bottom - 1.5); gr.Stroke (); gr.MoveTo (r.Left + 2.5, r.Top + 2.5); gr.LineTo (r.Left + 2.5, r.Bottom - l1); gr.LineTo (r.Left + l1, r.Bottom - 2.5); gr.LineTo (r.Right - 2.5, r.Bottom - 2.5); gr.LineTo (r.Right - 2.5, r.Top + l1); gr.LineTo (r.Right - l1, r.Top + 2.5); gr.ClosePath (); if (ClipToClientRect) //clip to client zone gr.ClipPreserve (); Background.SetAsSource (gr); gr.FillPreserve (); gr.LineWidth = 1.0; Foreground.SetAsSource (gr); gr.Stroke (); }
protected override bool OnExposeEvent(Gdk.EventExpose evnt) { using (Cairo.Context cr = Gdk.CairoHelper.Create(GdkWindow)) { cr.Rectangle(Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); cr.ClipPreserve(); cr.SetSourceRGB(1.00, 0.98, 0.91); cr.FillPreserve(); cr.SetSourceRGB(0.87, 0.83, 0.74); cr.LineWidth = 2; cr.Stroke(); } return(base.OnExposeEvent(evnt)); }
protected override bool OnExposeEvent(Gdk.EventExpose evnt) { using (Cairo.Context cr = Gdk.CairoHelper.Create(GdkWindow)) { cr.Rectangle(Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); cr.ClipPreserve(); cr.SetSourceColor(Styles.ExceptionCaughtDialog.InfoFrameBackgroundColor.ToCairoColor()); cr.FillPreserve(); cr.SetSourceColor(Styles.ExceptionCaughtDialog.InfoFrameBorderColor.ToCairoColor()); cr.LineWidth = 2; cr.Stroke(); } return(base.OnExposeEvent(evnt)); }
public override void FillPreserve(object backend) { var gtkc = (CairoContextBackend)backend; Cairo.Context ctx = gtkc.Context; var alpha = gtkc.GlobalAlpha * gtkc.PatternAlpha; if (alpha == 1) { ctx.FillPreserve(); } else { ctx.Save(); ctx.ClipPreserve(); ctx.PaintWithAlpha(alpha); ctx.Restore(); } }
public override void ClipPreserve(object backend) { Cairo.Context ctx = ((CairoContextBackend)backend).Context; ctx.ClipPreserve(); }
public void ClipPreserve(object backend) { Cairo.Context ctx = ((GtkContext)backend).Context; ctx.ClipPreserve(); }