title: Write image to Windows clipboard in python with PIL and win32clipboard?
body: <p>I'm trying to open an image file and copy the image to the Windows clipboard.  Is there a way to fix this:</p>
  
  <pre><code>import win32clipboard
  from PIL import Image
  
  def send_to_clipboard(clip_type, data): 
      win32clipboard.OpenClipboard()
      win32clipboard.EmptyClipboard()
      win32clipboard.SetClipboardData(clip_type, data) 
      win32clipboard.CloseClipboard()
  
  clip_type = win32clipboard.CF_BITMAP
  filepath = 'c:\\temp\\image.jpg'
  
  im = Image.open(filepath) 
  data = im.tobitmap() # fails with valueerror: not a bitmap
  # data = im.tostring() runs, but receiving programs can't read the results
  send_to_clipboard(clip_type, data)
  </code></pre>
  
  <p>I could install PythonMagick, etc., but would prefer not installing yet another library for a one-off program</p>