[pygtk] Re: Screenshots ? EXAMPLE anyone ?

george young gry at ll.mit.edu
Sat Oct 23 04:24:41 WST 2004


On Thu, 21 Oct 2004 08:42:51 +0000
Jean-Baptiste Cazier <jean-baptiste.cazier at decode.is> threw this fish to the penguins:

> ImageMagick sounds good, but how should i implement it ?
> Anybody has got a working example ?
> 
Here's my more complex codelet:

os.system("convert -background white -font Helvetica -draw 'scale 1.6,1.6 text 210,14 %s' -page 588x740-14+335 X:0x%x 'PS2:|lpr'" % (self.runwin.run.name, self.topwin.window.xid))

This uses "convert" which is part of the ImageMagick package.  The extra
complexity is to:

1) tune the size and position of the sceen image on the printed
page

2) draw a brief label string (self.runwin.run.name) at the top of the window.

3) send "convert" the X window id (in hexadecimal) so it can access the
window directly, instead of needing the user to click somewhere.

4) send the resultant postscript directly to the printer.

You probably don't need *all* this, but I thought some of the pieces might
be useful to some people.

> 
> On Thu, 21 Oct 2004 12:42:05 +0800 (WST)
> > 
> > ----------------------------------------------------------------------
> > 
> > Message: 1
> > Date: Wed, 20 Oct 2004 13:45:33 +0000
> > From: Jean-Baptiste Cazier <jean-baptiste.cazier at decode.is>
> > Subject: [pygtk] Screenshot ?
> > To: pygtk at daa.com.au
> > Message-ID: <20041020134533.0e439949.jean-baptiste.cazier at decode.is>
> > Content-Type: text/plain; charset=ISO-8859-1
> > 
> > S_l,
> > 
> > 
> > How can I take a screnshot of my main gtk.Window to save/print ?
> > 
> > Takk
> > 
> > Jean-Baptiste
> > PS: How can I search the full archive at once ?
> > 
> > -- 
> > -----------------------------
> > Jean-Baptiste.Cazier at decode.is
> > 
> > Department of Statistics
> > deCODE genetics     Sturlugata,8
> > 570 2993          101 Reykjav_k
> > 
> > 
> > 
> > ------------------------------
> > 
> > Message: 2
> > Date: Wed, 20 Oct 2004 13:44:07 -0300
> > From: Christian Robottom Reis <kiko at async.com.br>
> > Subject: Re: [pygtk] Screenshot ?
> > To: Jean-Baptiste Cazier <jean-baptiste.cazier at decode.is>
> > Cc: pygtk at daa.com.au
> > Message-ID: <20041020164407.GD15031 at www.async.com.br>
> > Content-Type: text/plain; charset=us-ascii
> > 
> > On Wed, Oct 20, 2004 at 01:45:33PM +0000, Jean-Baptiste Cazier wrote:
> > > How can I take a screnshot of my main gtk.Window to save/print ?
> > 
> > A bit offtopic, but either use Imagemagick's 'import' or something like
> > Gimp's screen capture function.
> > 
> > > PS: How can I search the full archive at once ?
> > 
> > Apart from using Google, I don't know.
> > 
> > Take care,
> > --
> > Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3361 2331
> > 
> > 
> 
> 
> -- 
> -----------------------------
> Jean-Baptiste.Cazier at decode.is
> 
> Department of Statistics
> deCODE genetics     Sturlugata,8
> 570 2993          101 Reykjavík
> 
> _______________________________________________
> pygtk mailing list   pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
> 


-- 
"Are the gods not just?"  "Oh no, child.
What would become of us if they were?" (CSL)


More information about the pygtk mailing list