-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
27 lines (25 loc) · 755 Bytes
/
Program.cs
File metadata and controls
27 lines (25 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using CommandLine;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using System;
namespace DotnetT4
{
class Program
{
static void Main(string[] args)
{
CommandLine.Parser.Default.ParseArguments<Options>(args)
.WithParsed<Options>(opts => RunOptions(opts));
}
static void RunOptions(Options options)
{
using (Image<Rgba32> image = Image.Load(options.ImageFile))
{
RuntimeTextTemplate1 t = new RuntimeTextTemplate1(image);
string text = t.TransformText();
System.IO.File.WriteAllText(options.OutputFile, text);
Console.WriteLine(text);
}
}
}
}