2009-05-21 122 views
1

我使用下面的代碼來記錄屏幕,當錄製時,用鼠標雙擊某個項目時,例如雙擊一個PPT在PowerPoint中打開它,它不是很響應。我已經嘗試過,使用Windows Media Encoder 9的屏幕錄製功能會更好。任何想法出了什麼問題?鼠標雙擊工作不太好

我的環境:Windows Vista + Windows Media編碼器9 + VSTS 2008 + C#。我在Windows窗體應用程序的初始化代碼中編寫了以下代碼,並且懷疑我的Windows窗體應用程序有問題?

我的代碼,

IWMEncSourceGroup SrcGrp; 
IWMEncSourceGroupCollection SrcGrpColl; 
SrcGrpColl = encoder.SourceGroupCollection; 
SrcGrp = (IWMEncSourceGroup)SrcGrpColl.Add("SG_1"); 

IWMEncVideoSource2 SrcVid; 
IWMEncSource SrcAud; 
SrcVid = (IWMEncVideoSource2)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO); 
SrcAud = SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO); 

SrcVid.SetInput("ScreenCap://ScreenCapture1", "", ""); 
SrcAud.SetInput("Device://Default_Audio_Device", "", ""); 

// Specify a file object in which to save encoded content. 
IWMEncFile File = encoder.File; 
string CurrentFileName = Guid.NewGuid().ToString(); 
File.LocalFileName = CurrentFileName; 
CurrentFileName = File.LocalFileName; 

// Choose a profile from the collection. 
IWMEncProfileCollection ProColl = encoder.ProfileCollection; 
IWMEncProfile Pro; 
for (int i = 0; i < ProColl.Count; i++) 
{ 
    Pro = ProColl.Item(i); 

    if (Pro.Name == "Screen Video/Audio High (CBR)") 
    { 
     SrcGrp.set_Profile(Pro); 
     break; 
    } 
} 
encoder.Start(); 

由於事先 喬治

回答

2

我面臨同樣的問題。但問題不在於我的代碼或我的。當我嘗試從Windows Media Encoder應用程序本身捕獲屏幕時,我在大約50%的會話中也面臨同樣的問題。很明顯這是WindowsMediaEncoder本身的錯誤。

喬治

+0

謝謝喬治!任何解決方案或建議? – George2 2009-07-05 13:34:35