public CanvasLayer(UGContext context, float alpha, UGRect clipRect) : this(context, 2) { _context.Native.PushOpacity(alpha); var geometry = new RectangleGeometry(clipRect.ToWPFRect()); _context.Native.PushClip(geometry); }
protected sealed override void OnRender(DrawingContext drawingContext) { base.OnRender(drawingContext); var matrix = PresentationSource.FromVisual(this).CompositionTarget.TransformToDevice; var scale = (float)matrix.M11; using (var ugContext = new UGContext(this, drawingContext, RenderSize, scale)) { DrawOverride(ugContext); } }
private CanvasLayer(UGContext context, int count) { _context = context; _count = count; }
public CanvasLayer(UGContext context, UGRect clipRect) : this(context, 1) { var geometry = new RectangleGeometry(clipRect.ToWPFRect()); _context.Native.PushClip(geometry); }
public CanvasLayer(UGContext context, float alpha) : this(context, 1) { _context.Native.PushOpacity(alpha); }
public CanvasLayer(UGContext context) : this(context, 0) { }