Scene Class

A drawing made of primitives (shapes, paths, texts, groups), independent of the output format. Charts and diagrams create it (ISceneSource.CreateScene); SvgSceneRenderer and the renderer of Meziantou.Framework.Imaging.VectorGraphics draw it.

public sealed class Scene

Remarks

The coordinates are in pixels, with the origin at the top-left corner and the y axis pointing down. Angles are in degrees, clockwise.

Constructors

NameDescription
Scene(double, double, string)Initializes a new instance of the Scene class.

Scene(double, double, string)

Scene.cs

Initializes a new instance of the Scene class.

public Scene(double width, double height, string fontFamily)

Parameters

width double
The width of the drawing.
height double
The height of the drawing.
fontFamily string
The CSS font-family of the texts.

Properties

NameDescription
BackgroundGets or sets the background, or null for a transparent background.
DescriptionGets or sets the accessible description of the drawing.
FontFamilyGets the CSS font-family of the texts.
FontsGets or sets the fonts that draw the texts, or null to let each renderer choose them. Set it to the fonts the texts were measured with (ITextMeasurer.Fonts), so they are drawn with the same fonts.
HeightGets the height of the drawing.
RootGets the elements of the drawing, drawn in order.
TitleGets or sets the accessible name of the drawing, usually its title.
WidthGets the width of the drawing.

Background

Scene.cs

Gets or sets the background, or null for a transparent background.

public SceneColor? Background { get; set; }

Property value

SceneColor?

Description

Scene.cs

Gets or sets the accessible description of the drawing.

public string? Description { get; set; }

Property value

string?

FontFamily

Scene.cs

Gets the CSS font-family of the texts.

public string FontFamily { get; }

Property value

string

Gets or sets the fonts that draw the texts, or null to let each renderer choose them. Set it to the fonts the texts were measured with (ITextMeasurer.Fonts), so they are drawn with the same fonts.

public SceneFontCollection? Fonts { get; set; }

Property value

SceneFontCollection?

Remarks

The family of a text is SceneFont.Family, or Scene.FontFamily when it is null.

Height

Scene.cs

Gets the height of the drawing.

public double Height { get; }

Property value

double

Gets the elements of the drawing, drawn in order.

public SceneGroup Root { get; }

Property value

SceneGroup

Gets or sets the accessible name of the drawing, usually its title.

public string? Title { get; set; }

Property value

string?

Gets the width of the drawing.

public double Width { get; }

Property value

double