SvgAvatarGeneratorGeneratePhoto - метод

Generates a generic SVG user photo placeholder with a silhouette icon.

Definition

Пространство имён: Tessa.Content.Avatars
Сборка: Tessa (в Tessa.dll) Версия: 4.2.0+ffad8363f63902f18b3b3f4cfa533a14b2fb19a6
C#
public static string GeneratePhoto(
	string? background = "#e0e0e0",
	string foreground = "#9e9e9e",
	int size = 512,
	bool round = false
)

Параметры

background  String  (Optional)
The background color of the avatar in hexadecimal format. Default is light gray (#e0e0e0).
foreground  String  (Optional)
The color of the user silhouette in hexadecimal format. Default is medium gray (#9e9e9e).
size  Int32  (Optional)
The width and height of the generated SVG in pixels. Default is 512px.
round  Boolean  (Optional)
Indicates whether the avatar should have rounded corners. When true, creates a circular avatar; when false, creates a square avatar. Default is false.

Возвращаемое значение

String
A string containing SVG markup representing a generic user photo placeholder. The SVG consists of a background rectangle and a simple user silhouette (head and shoulders).

Заметки

This method creates a neutral, gender-agnostic user representation suitable for cases where no actual photo is available. The generated SVG is vector-based and scales perfectly to any size. The default color scheme uses contrasting grays for clear visibility.

См. также