New to Telerik UI for WinForms? Start a free 30-day trial

Creates avatar images with an elliptical background that display the initials extracted from a name.

Definition

Namespace:Telerik.WinForms.Documents.UI.Mentions

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public class NameToInitialsImageSourceGenerator

Inheritance: objectNameToInitialsImageSourceGenerator

Constructors

C#
public NameToInitialsImageSourceGenerator()

Properties

Gets the brushes used to choose a random background color for each generated avatar.

C#
public List<Brush> DefaultBrushes { get; }

Keep at least one brush in the list so an image can select a background color.

Gets or sets the height, in pixels, of generated avatar images.

C#
public double Height { get; set; }
Property Value:

The configured height, or 30 pixels when no height has been set.

Gets or sets the width, in pixels, of generated avatar images.

C#
public double Width { get; set; }
Property Value:

The configured width, or 30 pixels when no width has been set.

Methods

Creates a bitmap avatar whose elliptical background contains the first character of each word in the specified name.

C#
public Bitmap Generate(string value)
Parameters:valuestring

The name from which to extract initials.

Returns:

Bitmap

A bitmap with a randomly colored elliptical background and white initials.

Creates a WPF image source for the initials avatar generated from the specified name.

C#
public BitmapSource GenerateImageSource(string value)
Parameters:valuestring

The name from which to extract initials.

Returns:

BitmapSource

A WPF image source containing the generated avatar.