Screenshot in Tkinter 
Author Message
 Screenshot in Tkinter

Is it possible to get a screenshot (as a bitmap) in Tkinter, using Python?
All I want is to be able to say - I want a screenshot of it for printing (to a printer).
Grzegorz


Thu, 24 Jun 2004 14:22:07 GMT  
 Screenshot in Tkinter

Quote:

> Is it possible to get a screenshot (as a bitmap) in Tkinter, using Python?
> All I want is to be able to say - I want a screenshot of it for printing
> (to a printer).

Since you are using SunOS and hence X-Windows, I would suggest you use the
common Unix command line utility xwd (X Window Dump) as follows.

   1) In an terminal window run "xwd >a.xwd" and you should notice the
      cursor changes shape.
   2) Now clock on the winod you want a screenshot of or the background
      to capture the whole screen.

This will create a file named "a.xwd" containing your screen shot. This can
be loaded into a grphics editing packages like the Gimp for printing or
modification.

Hope this helps,
Erik
--
+-----------------------------------------------------------+

+-----------------------------------------------------------+
Seen on usenet (possibly a quote from an IBM exec):
"Each large company needs its Vietnam, and Microsoft will
 experience it with NT..."



Thu, 24 Jun 2004 17:41:36 GMT  
 Screenshot in Tkinter

Quote:

> Is it possible to get a screenshot (as a bitmap) in Tkinter, using Python?
> All I want is to be able to say - I want a screenshot of it for printing
> (to a printer). Grzegorz

If what you're trying to print is the contents of a canvas, and if you have
a postscript printer, there is also a "postscript" method on Tkinter
canvases that may interest you. It just returns the postscript code
corresponding to the contents of the canvas.
And if you don't have a PostScript printer, there are many conversion
utilities that may convert the PostScript to almost any other format. See

http://www.imagemagick.org

HTH
 - eb -



Fri, 25 Jun 2004 18:06:33 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Extensions/tkinter/* vs Modules/tkinter* (was: Python 1.1 w/ tkinter for AIX)

2. GraphicsCcontext and bounds - screenshot.gif (0/1)

3. Silly Screenshot Capture Question

4. How to take a screenshot from REALbasic?

5. Windows API for screenshot

6. LogFlash & IMPEX - new screenshot pages

7. get an IE 5 screenshot

8. high-resolution RDE screenshot needed

9. fyi: screenshot of jEdit used to code Ada

10. Screenshot again

11. Coolest Tk Screenshot Contest: Win ActiveTcl Pro Studio!

12. ActiveState contest: Coolest Tk Screenshot

 

 
Powered by phpBB® Forum Software