有关在C#中设置FIle Writer的问题 [英] Question about setting up FIle Writer in C#
问题描述
我在C#中使用DirectShowLib。我想在C#中使用File Writer来设置文件输出。我想使用File Writer,因为Graph.SetOutputFileName()不会连接到我的编码器,但是File Writer可以。我该如何在C#中设置文件编写器保存的文件?
Im using DirectShowLib in C#. I want to use File Writer in C# to set a file output. I want to use File Writer because Graph.SetOutputFileName() wont connect to my encoder, but File Writer will. How can i set the File that File Writer saves to in C#?
我尝试像DxPropPages示例中那样拉起其属性页,但文件不会出现
I tried pulling up its property pages like in the DxPropPages example but one won't come up for File Writer.
推荐答案
从此处
IBaseFilter ibf = new FileWriter() as IBaseFilter;
更新:
我知道如何在代码中将文件编写器添加到我的
图中,我只是不知道如何
设置文件路径
"I know how to add file writer to my graph in code i just dont know how to set the file path"
尝试以下操作:
FileWriter fileWriter = new FileWriter();
IFileSinkFilter fileSinkFilter = (IFileSinkFilter)fileWriter;
fileSinkFilter.SetFileName(fileOutput, null);
此处是一个有用的链接,显示了完整运行的示例。该示例演示了DES的使用,但是您应该从中获得一般的想法。
Here a useful link that shows a full running example. the example is demonstrating the use of DES but you should get the general idea from it.
这篇关于有关在C#中设置FIle Writer的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!