Gtk screenshot program wiredness (python) -
Gtk screenshot program wiredness (python) -
i found python code online taking continuous screenshots gtk have major problem. when run code:
import cv2 import image import numpy np def getscreenbygtk(): import gtk.gdk w = gtk.gdk.get_default_root_window() sz = w.get_size() pb = gtk.gdk.pixbuf(gtk.gdk.colorspace_rgb,false,8,sz[0],sz[1]) pb = pb.get_from_drawable(w,w.get_colormap(),0,0,0,0,sz[0],sz[1]) if (pb == none): homecoming false else: width,height = pb.get_width(),pb.get_height() homecoming image.fromstring("rgb",(width,height),pb.get_pixels() ) cv2.namedwindow('image', cv2.window_normal) while true: screen_img = getscreenbygtk() screen_img_array = np.asarray(screen_img) cv2.imshow('image',screen_img_array) cv2.waitkey(1) cv2.destroyallwindows()
it gives me images slanted left:
i've been trying find solution online can't.
i'm running lubuntu 12.04 in virtual box
python gtk
Comments
Post a Comment