Example #1
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));
     }
 }
Example #2
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;
            }));
        }