0

My screencapturejob.rectangle results in a exception(ArgumentOutOfRange).

Here's my code:

    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();
    }

I use expression encoder pro free. It works fine but in this case we get the exception, can anyone tell me what I'm doing wrong.

Terry
  • 5,132
  • 4
  • 33
  • 66
  • Look which signatures are available and makes sure the value of an argument is not outside the allowable range of values. – Terry Jun 12 '13 at 13:08

2 Answers2

0

ScreenCaptureJob does not accept values that are not multiple of 4. I have some problems using it and to prevent other issues I enforce the dimensions to be multiple of 16.

BR

0

Are you trying to record the whole screen?
I would suggest this if you're trying to:

using System.Windows.Forms;
...
Rectangle screenRectangle = Screen.PrimaryScreen.Bounds;
job.CaptureRectangle = screenRectangle;
newbieguy
  • 658
  • 2
  • 11
  • 29