0

I did a screen recorder and drew a rectangle to be a screen.

 void ÇekimeBaşla()
    {
        Job = new ScreenCaptureJob();
        System.Drawing.Size WorkingArea = SystemInformation.PrimaryMonitorSize;
        Rectangle CaptureRect = new Rectangle(40, 40, WorkingArea.Width + 20000, WorkingArea.Height + 20000);
        try
        {
    Job.CaptureRectangle = CaptureRect;
        }
        catch (ArgumentOutOfRangeException)
        {
            MessageBox.Show("A");

        }

As you see I am using try and catch because the size is too big. But it doesn't records the full screen! Why could it be? Note: When the record is started the form automatically shrinks, why?

  • 4
    What is `ScreenCaptureJob`? Why are you adding 20,000 pixels to the size? The screen couldn't possibly be that big. – Ron Beyer May 14 '18 at 15:03
  • Are you getting an exception? – Andrew May 14 '18 at 15:05
  • Like what Ron said, adding 20K pixels on each dimension means adding more than 400 million pixels overall. – Andrew May 14 '18 at 15:17
  • Both the "doesn't record full screen" and the "form automatically shrinks" complaints are a very strong hint that you need to declare your app to be dpiAware. Necessary to stop the OS from lying to you and to avoid trouble with WPF code on Win10 Creators. https://stackoverflow.com/a/13228495/17034 You can buy more address space with Project > Properties > Build tab, untick "Prefer 32-bit", but it would be wise to hunt for missing Dispose() calls first. – Hans Passant May 14 '18 at 15:34
  • No I am not taking an expection ,Andrew. – Akın Işık May 18 '18 at 20:23
  • (Hans Passant May) It is a very late but (I want to be sure would it work or not )thanks, it really worked. – Akın Işık May 28 '18 at 14:38

0 Answers0