title: Performing ImageGrab on tkinter Screen
body: <p>
  I am trying to save a tkinter screen to a file (to later convert into a video).</p>
  
  <p>I can't get the correct position of the canvas for using ImageGrab.</p>
  
  <p>
  My relevant imports are:</p>
  
  <pre><code>import tkinter
  import pyscreenshot as ImageGrab 
  </code></pre>
  
  <p>I am trying to save the screen using (after drawing the screen):</p>
  
  
  
  <pre><code>grab = ImageGrab.grab(bbox=canvas.bbox())
  ImageGrab.grab_to_file(fileName,grab)
  </code></pre>
  
  <p>I don't know how to get the canvas position for using "ImageGrab.grab".</p>
  
  <p>Is there any way to get the bounding box for the whole canvas, so as to later use ImageGrab to store a screenshot?</p>
  
  
  
  <p><strong>---Edit------------------------------------------------------------------</strong></p>
  
  <p>Solution:</p>
  
  <pre><code>box = (canvas.winfo_rootx(),canvas.winfo_rooty(),canvas.winfo_rootx()+canvas.winfo_width(),canvas.winfo_rooty() + canvas.winfo_height())
  grab = ImageGrab.grab(bbox = box)
  grab.save(file_path)
  </code></pre>