Exemplo n.º 1
0
 protected override void OnUpdate(RenderContext2D context)
 {
     base.OnUpdate(context);
     if (_opacityMaskChanged)
     {
         (SceneNode as PathNode2D).OpacityMask = OpacityMask.ToD2DBrush(SceneNode.RenderSize, context.DeviceContext);
         _opacityMaskChanged = false;
     }
 }
Exemplo n.º 2
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox here = (ComboBox)sender;

            switch (here.SelectedIndex)
            {
            case 0:
                useMask = null;
                break;

            case 1:
                useMask = OpacityMask.CircleMask(70);
                break;
            }
            count();
        }
Exemplo n.º 3
0
 public override void Render(RenderContext parentRenderContext)
 {
     if (OpacityMask == null && (TotalHeight > ActualHeight || TotalWidth > ActualWidth))
     {
         SolidColorBrush brush = new SolidColorBrush {
             Color = Color.Black
         };
         OpacityMask        = brush;
         _forcedOpacityMask = true;
     }
     else if (_forcedOpacityMask && TotalHeight <= ActualHeight && TotalWidth <= ActualWidth && OpacityMask != null)
     {
         OpacityMask.Dispose();
         OpacityMask = null;
         _opacityMaskContext.Dispose();
         _opacityMaskContext = null;
         _forcedOpacityMask  = false;
     }
     base.Render(parentRenderContext);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Required to clip any items that are partially within the panel's bounds
 /// </summary>
 /// <param name="parentRenderContext"></param>
 public override void Render(RenderContext parentRenderContext)
 {
     if (OpacityMask == null && _actualPhysicalOffset != 0)
     {
         SolidColorBrush brush = new SolidColorBrush {
             Color = Color.Black
         };
         OpacityMask        = brush;
         _forcedOpacityMask = true;
     }
     else if (_forcedOpacityMask && _actualPhysicalOffset == 0 && OpacityMask != null)
     {
         OpacityMask.Dispose();
         OpacityMask = null;
         _opacityMaskContext.Dispose();
         _opacityMaskContext = null;
         _forcedOpacityMask  = false;
     }
     base.Render(parentRenderContext);
 }