Click or drag to resize

Identicon Class

Represents an identicon for a specific hash.
Inheritance Hierarchy
SystemObject
  JdenticonIdenticon

Namespace:  Jdenticon
Assembly:  Jdenticon.dll
Syntax
public class Identicon

The Identicon type exposes the following members.

Constructors
  NameDescription
Public methodIdenticon
Creates an Identicon instance with the specified hash.
Top
Properties
  NameDescription
Public propertyHash
Gets the hash that is used as base for this icon.
Public propertyIconGenerator
Gets or sets the IconGenerator used to generate icons.
Public propertySize
Gets or sets the size of the icon.
Public propertyStyle
Gets or sets the style of the icon.
Top
Methods
  NameDescription
Public methodDraw
Draws this icon using a specified renderer.
Public methodStatic memberFromHash(Byte, Int32)
Creates an Identicon instance from a specified hash.
Public methodStatic memberFromHash(String, Int32)
Creates an Identicon instance from a hexadecimal hash string.
Public methodStatic memberFromValue
Generates a hash for a specified value and creates an Identicon instance from the generated hash.
Public methodGetIconBounds
Gets the bounds of the icon excluding its padding.
Public methodToString
Gets a string representation of this Identicon.
Top
Extension Methods
  NameDescription
Public Extension MethodDraw(Graphics, Rectangle)
Draws an Identicon in a specified GDI drawing context.
Public Extension MethodDraw(Graphics, Rectangle)
Draws an Identicon in a specified GDI drawing context.
Public Extension MethodDraw(DrawingContext, Rectangle)
Draws an Identicon in a specified WPF drawing context.
Public Extension MethodDraw(DrawingContext, Rect)
Draws an Identicon in a specified WPF drawing context.
Public Extension MethodSaveAsEmf
Saves an Identicon as an Enhanced Metafile (EMF).
Public Extension MethodSaveAsEmf(Stream)
Saves an Identicon as an Enhanced Metafile (EMF).
Public Extension MethodSaveAsEmf(String)
Saves an Identicon as an Enhanced Metafile (EMF).
Public Extension MethodSaveAsPng
Saves an Identicon icon as a Portable Network Graphics (PNG) file.
Public Extension MethodSaveAsPng(Stream)
Saves an Identicon icon as a Portable Network Graphics (PNG) file.
Public Extension MethodSaveAsPng(String)
Saves an Identicon icon as a Portable Network Graphics (PNG) file.
Public Extension MethodSaveAsSvg
Saves an Identicon icon as a Scalable Vector Graphics (SVG) file.
Public Extension MethodSaveAsSvg(TextWriter)
Saves an Identicon icon as a Scalable Vector Graphics (SVG) file.
Public Extension MethodSaveAsSvg(Stream)
Saves an Identicon icon as a Scalable Vector Graphics (SVG) file.
Public Extension MethodSaveAsSvg(String)
Saves an Identicon icon as a Scalable Vector Graphics (SVG) file.
Public Extension MethodSaveAsSvg(Boolean)
Saves an Identicon icon as a Scalable Vector Graphics (SVG) file.
Public Extension MethodSaveAsSvg(TextWriter, Boolean)
Saves an Identicon icon as a Scalable Vector Graphics (SVG) file.
Public Extension MethodSaveAsSvg(Stream, Boolean)
Saves an Identicon icon as a Scalable Vector Graphics (SVG) file.
Public Extension MethodSaveAsSvg(String, Boolean)
Saves an Identicon icon as a Scalable Vector Graphics (SVG) file.
Public Extension MethodToBitmap
Renders an Identicon to a GDI Bitmap.
Public Extension MethodToSvg
Renders an Identicon as a Scalable Vector Graphics (SVG) data string.
Public Extension MethodToSvg(Boolean)
Renders an Identicon as a Scalable Vector Graphics (SVG) data string.
Public Extension MethodToVisual
Renders an Identicon as a WPF Visual.
Top
Remarks
Note Note

The operations to save and export the icon are implemented as extension methods located in the Jdenticon namespace.

Examples

Before using Identicon the Jdenticon-net package needs to be added to the project. Use the NuGet Package Manager to add a reference.

NuGet Package Manager
PM> Install-Package Jdenticon-net

The following code illustrates how to use Jdenticon to generate an icon from a string and save it as a PNG image. Note that all save operations are implemented as extension methods, which means a using for the Jdenticon namespace is required.

Generate identicon as PNG
using Jdenticon;
// ...
Identicon
    .FromValue("string to hash", size: 160)
    .SaveAsPng("test.png");
See Also