mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 00:24:14 +01:00
5f5db69bcd
Former-commit-id: 8e9b7df4de
23 lines
No EOL
615 B
C#
23 lines
No EOL
615 B
C#
using System;
|
|
using System.Drawing;
|
|
using System.IO;
|
|
|
|
namespace FFMpegCore.Extensions.System.Drawing.Common
|
|
{
|
|
public static class BitmapExtensions
|
|
{
|
|
public static bool AddAudio(this Image poster, string audio, string output)
|
|
{
|
|
var destination = $"{Environment.TickCount}.png";
|
|
poster.Save(destination);
|
|
try
|
|
{
|
|
return FFMpegImage.PosterWithAudio(destination, audio, output);
|
|
}
|
|
finally
|
|
{
|
|
if (File.Exists(destination)) File.Delete(destination);
|
|
}
|
|
}
|
|
}
|
|
} |