#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    174
    Rep Power
    11

    using python to make screenshots?


    any ideas on using python to generate window screenshots? (win32) I'm tired of print screening and then cutting out the active window. Perhaps some COM coding?

    Any suggestions in advance are highly appreciated.

    cheers
    sf2k
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    624
    Rep Power
    35
    I'm tired of print screening and then cutting out the active window. Perhaps some COM coding?

    Any suggestions in advance are highly appreciated.
    I suggest you press alt-printscreen.

    Comments on this post

    • jacktasia agrees
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    174
    Rep Power
    11
    haha... yes i know about that one... ok i really should have been more specific of course...sorry about that.

    I want to _automatically_ generate screenshots (images of the page) based upon defined links and passages of text on a website that should exist (which I'm checking for). The basic idea is that if the next page on my hitlist lacks a certain link it will collect a screenshot of the page for me.

    This is going to (eventually) generate a ppt file using COM from a python server I suppose, since this will be really useful at work.

    I'll play around with PIL but can it capture? Or rather, does win32com/win32gui have the API that does the ctrl/alt printscreen for me? Or should I just find a way to take the data from the clipboard during a copy/paste operation?

    Yes I'm a bit unaware of my tools, but know Python will help me on my way ...somehow you can guess that I'm a bit lost on what to do and where to go, so any directions/pointers would be veeeery gratefully accepted.

    of course I'll post my code as I go. Just snippets of ideas for now.

    cheers
    sf2k
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Location
    Regensburg, Germany
    Posts
    147
    Rep Power
    17
    Creating screen shots should be possible using wxPython. See http://wiki.wxpython.org/index.cgi/WorkingWithImages chapter 4: 'Screen Capture' for an example.

    Hope this helps.

    Comments on this post

    • sf2k agrees : thanks
  8. #5
  9. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    174
    Rep Power
    11
    excellent, thanks. i'll give it a try
  10. #6
  11. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    If you are only interested in Windows then you can use the ImageGrab module, included with PIL; this might not be what you're looking for though:

    http://www.pythonware.com/library/pil/handbook/imagegrab.htm

    Take care,

    Mark.
    programming language development: www.netytan.com Hula


IMN logo majestic logo threadwatch logo seochat tools logo