예제 #1
0
        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);
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
 private CanvasLayer(UGContext context, int count)
 {
     _context = context;
     _count   = count;
 }
예제 #4
0
        public CanvasLayer(UGContext context, UGRect clipRect) : this(context, 1)
        {
            var geometry = new RectangleGeometry(clipRect.ToWPFRect());

            _context.Native.PushClip(geometry);
        }
예제 #5
0
 public CanvasLayer(UGContext context, float alpha) : this(context, 1)
 {
     _context.Native.PushOpacity(alpha);
 }
예제 #6
0
 public CanvasLayer(UGContext context) : this(context, 0)
 {
 }