Add canvas and image support

Adds support for drawing "pixels" and displaying
images in the terminal.
This commit is contained in:
Patrik Svensson
2020-11-24 21:24:21 +01:00
committed by Patrik Svensson
parent 4f6eca4fcb
commit 2a9fa223de
11 changed files with 633 additions and 94 deletions

View File

@ -7,34 +7,34 @@ namespace EmojiExample
public static void Main(string[] args)
{
// No title
WrapInPanel(
Render(
new Rule()
.RuleStyle(Style.Parse("yellow"))
.AsciiBorder()
.LeftAligned());
// Left aligned title
WrapInPanel(
Render(
new Rule("[blue]Left aligned[/]")
.RuleStyle(Style.Parse("red"))
.DoubleBorder()
.LeftAligned());
// Centered title
WrapInPanel(
Render(
new Rule("[green]Centered[/]")
.RuleStyle(Style.Parse("green"))
.HeavyBorder()
.Centered());
// Right aligned title
WrapInPanel(
Render(
new Rule("[red]Right aligned[/]")
.RuleStyle(Style.Parse("blue"))
.RightAligned());
}
private static void WrapInPanel(Rule rule)
private static void Render(Rule rule)
{
AnsiConsole.Render(rule);
AnsiConsole.WriteLine();