示例#1
0
        /// <summary>
        /// Draws an <see cref="Identicon"/> in a specified GDI drawing context.
        /// </summary>
        /// <param name="icon">The identicon to draw.</param>
        /// <param name="g">Drawing context in which the icon will be rendered.</param>
        /// <param name="rect">The bounds of the rendered icon, including padding.</param>
        public static void Draw(this Identicon icon, Graphics g, Rendering.Rectangle rect)
        {
            var renderer = new GdiRenderer(g);

            icon.Draw(renderer, rect);
        }
示例#2
0
        /// <summary>
        /// Draws an <see cref="Identicon"/> in a specified WPF drawing context.
        /// </summary>
        /// <param name="icon">The identicon to draw.</param>
        /// <param name="drawingContext">Drawing context in which the icon will be rendered.</param>
        /// <param name="rect">The bounds of the rendered icon, including padding.</param>
        public static void Draw(this Identicon icon, DrawingContext drawingContext, Rendering.Rectangle rect)
        {
            var renderer = new WpfRenderer(drawingContext);

            icon.Draw(renderer, rect);
        }