title: How can I convert canvas content to an image?
body: <pre><code>from Tkinter import *
  root = Tk()
  cv = Canvas(root)
  cv.create_rectangle(10,10,50,50)
  cv.pack()
  root.mainloop()
  </code></pre>
  
  <p>I want to convert canvas content to a bitmap or other image, and then do other operations, such as rotating or scaling the image, or changing its coordinates.</p>
  
  <p>Bitmaps can improve efficiency to show if I am no longer drawing.</p>
  
  <p>What should I do?</p>