mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
parent
64363d2f71
commit
0ca11ec962
1 changed files with 26 additions and 0 deletions
|
@ -82,6 +82,32 @@ public static ArgumentContainer DisableChannel(this ArgumentContainer container,
|
|||
return container;
|
||||
}
|
||||
|
||||
public class DrawTextOptions
|
||||
{
|
||||
public string Text { get; set; }
|
||||
public string FontPath { get; set; }
|
||||
public List<(string, string)> Params { get; private set; }
|
||||
|
||||
public DrawTextOptions()
|
||||
{
|
||||
Params = new List<(string, string)>();
|
||||
}
|
||||
|
||||
public DrawTextOptions AddParam(string key, string value)
|
||||
{
|
||||
Params.Add((key, value));
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public static ArgumentContainer DrawText(this ArgumentContainer container, Action<DrawTextOptions> builder)
|
||||
{
|
||||
var argumentParams = new DrawTextOptions();
|
||||
builder.Invoke(argumentParams);
|
||||
container.Add(new DrawTextArgument(argumentParams.Text, argumentParams.FontPath, argumentParams.Params.ToArray()));
|
||||
return container;
|
||||
}
|
||||
|
||||
public static ArgumentContainer DrawText(this ArgumentContainer container, string text, string fontPath, params (string, string)[] optionalArguments)
|
||||
{
|
||||
container.Add(new DrawTextArgument(text, fontPath, optionalArguments));
|
||||
|
|
Loading…
Reference in a new issue