SpectreCanvas

Class

For examples and usage details, see the component documentation.

View SpectreCanvas Component
Namespace: RazorConsole.Components
Assembly: RazorConsole.Core

Definition

public class SpectreCanvas : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

Constructors

1
NameTypeDescription
SpectreCanvas()Constructor—

Properties

6
NameTypeDescription
Appearance
CanvasHeightInt32Height of the canvas in pixels.
CanvasWidthInt32Width of the canvas in pixels.
MaxWidthNullable<Int32>Maximum width of the rendered canvas in console characters. If null, no constraint is applied.
PixelWidthInt32Width of each pixel when rendered. Default is 2 characters, creating more square-looking pixels.
Other
PixelsSystem.ValueTuple<System.Int32,System.Int32,Spectre.Console.Color>[]Renders a pixel-based canvas for drawing graphics in the console using Spectre.Console's Canvas renderable.
ScaleBooleanWhether the canvas should automatically scale to fit the console. Default is false.

Methods

4
NameTypeDescription
BuildRenderTree(RenderTreeBuilder)()MethodRenders the component to the supplied RenderTreeBuilder.
Dispose()Method—
OnInitialized()MethodMethod invoked when the component is ready to start, having received its initial parameters from its parent in the render tree.
OnParametersSet()MethodMethod invoked when the component has received parameters from its parent in the render tree, and the incoming values have been assigned to properties.