dogtail-devel [Bug 429347] Dogtail's utils.screenshot() not working properly on exported display
- From: "dogtail (bugzilla.gnome.org)" <bugzilla-daemon bugzilla gnome org>
- To: dogtail-devel-list gnome org
- Subject: dogtail-devel [Bug 429347] Dogtail's utils.screenshot() not working properly on exported display
- Date: Wed, 12 Dec 2007 17:36:12 +0000 (UTC)
If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
http://bugzilla.gnome.org/show_bug.cgi?id=429347
dogtail | Framework | Ver: 0.6.1
------- Comment #6 from Zack Cerza 2007-12-12 17:36 UTC -------
OK, I'm not sure why I was unable to reproduce this before, but I can now.
Here's the code in question:
import gtk.gdk
import gobject
rootWindow = gtk.gdk.get_default_root_window()
geometry = rootWindow.get_geometry()
pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, geometry[2], \
geometry[3])
gtk.gdk.Pixbuf.get_from_drawable(pixbuf, rootWindow, \
rootWindow.get_colormap(), 0, 0, 0, 0, geometry[2], geometry[3])
# gtk.gdk.Pixbuf.save() needs 'jpeg' and not 'jpg'
if fileExt == 'jpg': fileExt = 'jpeg'
try: pixbuf.save(path, fileExt)
except gobject.GError:
raise ValueError, "Failed to save screenshot in %s format" % fileExt
It seems like since the root window has the correct dimensions (at least in my
case), that everything would be fine. But for some reason
gtk.gdk.Pixbuf.get_from_drawable() isn't doing anything - it's leaving the
pixbuf blank.
--
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.
You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=429347.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]