Ejemplo n.º 1
0
 /// <inheritdoc />
 public override void SetBackground(JdenticonColor color, Rectangle iconBounds)
 {
     context.DrawRectangle(
         brush: new SolidColorBrush(color.ToWpf()),
         pen: null,
         rectangle: iconBounds.ToWpf());
 }
Ejemplo n.º 2
0
 /// <inheritdoc />
 public override void SetBackground(JdenticonColor color)
 {
     if (color.A > 0)
     {
         context.DrawRectangle(
             brush: new SolidColorBrush(color.ToWpfColor()),
             pen: null,
             rectangle: new Rect(0, 0, width, height));
     }
 }
Ejemplo n.º 3
0
        /// <inheritdoc />
        public override IDisposable BeginShape(JdenticonColor color)
        {
            if (!pathsByColor.TryGetValue(color, out currentPath))
            {
                pathsByColor[color] = currentPath = new PathGeometry
                {
                    FillRule = FillRule.Nonzero
                };
            }

            return(ActionDisposable.Empty);
        }
Ejemplo n.º 4
0
        /// <inheritdoc />
        public override IDisposable BeginShape(JdenticonColor color)
        {
            currentPath = new PathGeometry
            {
                FillRule = FillRule.Nonzero
            };

            return(new ActionDisposable(() =>
            {
                context.DrawGeometry(
                    brush: new SolidColorBrush(color.ToWpfColor()),
                    pen: null,
                    geometry: currentPath);
                currentPath = null;
            }));
        }