2013-06-12 25 views
0

我的screencapturejob.rectangle導致異常(ArgumentOutOfRange)。表達式編碼器screencapturejob捕獲矩形超出範圍例外

這裏是我的代碼:

private void RecButton_Checked(object sender, RoutedEventArgs e) 
    { 
     System.Drawing.Size monitorSize = SystemInformation.PrimaryMonitorSize; 
     Rectangle capRect = new Rectangle(0, 0,monitorSize.Height, monitorSize.Width); 

     job.CaptureRectangle = capRect; ------------- 

     // job.CaptureRectangle = (0,0,capRect.Width,capRect.Height); 
     job.OutputPath = @"C:\output\ScreenCap"; 
     job.Start(); 
    } 

我使用表達編碼器親免費。它工作正常,但在這種情況下,我們得到的例外,任何人都可以告訴我我做錯了什麼。

+0

目光簽名可用,並確保參數的值不是值的允許範圍之外:
如果你想我會建議這一點。 – Terry

回答

0

ScreenCaptureJob不使用它,以防止其他問題我執行尺寸是多個16

BR

0

你想的不接受是不是4的倍數值,我有一些問題記錄整個屏幕?

using System.Windows.Forms; 
... 
Rectangle screenRectangle = Screen.PrimaryScreen.Bounds; 
job.CaptureRectangle = screenRectangle;