Generates a random avatar with the following specs: i. Background: Solid color (chosen via Round Robin from a predefined color palette) ii. Foreground: First two initials of the display name in white
Namespace:  Microsoft.TeamFoundation.Framework.Server
Assembly:  Microsoft.TeamFoundation.Framework.Server (in Microsoft.TeamFoundation.Framework.Server.dll)
Syntax
'Declaration
Public Shared Function GenerateAvatar ( _
    displayName As String, _
    backgroundColor As Color, _
    avatarSizeInPixels As Integer, _
    avatarImageFormat As AvatarImageFormat _
) As Byte()
public static byte[] GenerateAvatar(
    string displayName,
    Color backgroundColor,
    int avatarSizeInPixels,
    AvatarImageFormat avatarImageFormat
)
public:
static array<unsigned char>^ GenerateAvatar(
    String^ displayName, 
    Color backgroundColor, 
    int avatarSizeInPixels, 
    AvatarImageFormat avatarImageFormat
)
static member GenerateAvatar : 
        displayName:string * 
        backgroundColor:Color * 
        avatarSizeInPixels:int * 
        avatarImageFormat:AvatarImageFormat -> byte[] 
public static function GenerateAvatar(
    displayName : String, 
    backgroundColor : Color, 
    avatarSizeInPixels : int, 
    avatarImageFormat : AvatarImageFormat
) : byte[]
Parameters
- displayName
 Type: System.String
- backgroundColor
 Type: System.Drawing.Color
- avatarSizeInPixels
 Type: System.Int32
- avatarImageFormat
 Type: Microsoft.TeamFoundation.Framework.Server.AvatarImageFormat
Return Value
Type: array<System.Byte[]
A byte array of the generated image
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.