Added the possibility for a command after capturing.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2288 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-11-15 16:38:19 +00:00
commit 485a814251

View file

@ -285,15 +285,34 @@ namespace Greenshot.Helpers {
// free up the Bitmap object
GDI32.DeleteObject(hDIBSection);
}
if (aviWriter != null) {
aviWriter.Dispose();
aviWriter = null;
MessageBox.Show("Recording written to " + filename);
}
if (disabledDWM) {
DWM.EnableComposition();
}
if (aviWriter != null) {
aviWriter.Dispose();
aviWriter = null;
string ffmpegexe = PluginUtils.GetExePath("ffmpeg.exe");
if (ffmpegexe != null) {
try {
string webMFile = filename.Replace(".avi", ".webm");
ProcessStartInfo processStartInfo = new ProcessStartInfo(ffmpegexe, "-i \"" + filename + "\" -vcodec libvpx -g 30 \"" + webMFile + "\"");
processStartInfo.CreateNoWindow = false;
processStartInfo.RedirectStandardOutput = false;
processStartInfo.UseShellExecute = false;
Process process = Process.Start(processStartInfo);
process.WaitForExit();
if (process.ExitCode == 0) {
MessageBox.Show("Recording written to " + webMFile);
}
} catch (Exception ex) {
MessageBox.Show("Recording written to " + filename + " couldn't convert due to an error: " + ex.Message);
}
} else {
MessageBox.Show("Recording written to " + filename);
}
}
}
}
}