我正在使用Splicer 使用c#
hereusing (WindowsMediaRenderer renderer = new WindowsMediaRenderer(timeline, "output.wmv", WindowsMediaProfiles.HighQualityVideo))
{
renderer.Render();
// How to Stop this render
}
}
我找到了使用progressParticipant
PercentageProgressParticipant progressParticipant = new PercentageProgressParticipant(timeline);
progressParticipant.ProgressChanged += new EventHandler<Splicer.Renderer.ProgressChangedEventArgs>(progressParticipant_ProgressChanged);
并将渲染器承包商更改为
using (WindowsMediaRenderer renderer =new WindowsMediaRenderer(timeline, "output.wmv", WindowsMediaProfiles.HighQualityVideo, new ICallbackParticipant[] { progressParticipant },null))
{
renderer.Render();
}
ProgressChanged
方法
public void progressParticipant_ProgressChanged(object sender, Splicer.Renderer.ProgressChangedEventArgs e)
{
double D = double.Parse(e.Progress.ToString())*100.0;
int P = (int)D;
_bw.ReportProgress(P);
}
我可以使用ICallbackParticipant
或其他任何方式停止渲染吗?