mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-08-02 18:17:30 +08:00
Add canvas and image support
Adds support for drawing "pixels" and displaying images in the terminal.
This commit is contained in:

committed by
Patrik Svensson

parent
4f6eca4fcb
commit
2a9fa223de
@ -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();
|
||||
|
Reference in New Issue
Block a user