title: Take screenshot of specific part of screen
body: <p>I'm trying to take a screenshot of a specific part of the screen. Here is the coordinates of the part of the screen i want to 'cut' :</p>
  
  <p>Left : 442
  Top : 440
  Right : 792
  Bottom : 520</p>
  
  <p>That is, a rectangle of width 350px and height of 80px. But i don't know how to use CopyRect to achieve this task, instead i'm getting a blank image. Here is my code :</p>
  
  <pre><code>function screenshot: boolean;
  var
    Bild : TBitmap;
    c: TCanvas;
    rect_source, rect_destination : TRect;
  begin
     c := TCanvas.Create;
     bild := tbitmap.Create;
     c.Handle := GetWindowDC(GetDesktopWindow);
     try
       rect_source := Rect(0, 0, Screen.Width, Screen.Height);
       rect_destination := Rect(442,440,792,520);
       Bild.Width := 350;
       Bild.Height := 80;
       Bild.Canvas.CopyRect(rect_destination, c, rect_source);
       Bild.savetofile('c:\users\admin\desktop\screen.bmp');
     finally
      ReleaseDC(0, c.Handle);
       Bild.free;
       c.Free;
     end;
  end;
  </code></pre>