我试图使用GdkPixbuf.Pixbuf.new_from_data(),如GTK2.x所示,并传递7个参数。但是它给了我一个错误,我需要传递9个参数。
我现在所做的是为gtk2.x工作。所以我想出了另外两个我需要通过的论点。
http://developer.gimp.org/api/2.0/gdk-pixbuf/gdk-pixbuf-creating.html
http://developer.gimp.org/api/2.0/gdk-pixbuf/gdk-pixbuf-refcounting.html#GdkPixbufDestroyNotify
其中一个参数是GdkPixbuf.PixbufDestroyNotify类型的。我不知道该怎么做。
我正在尝试ipython中的帮助(GdkPixbuf.PixbufDestroyNotfiy),但是我得到了一个错误。
错误: NotImplementedError.
self.img_pixbuf = GdkPixbuf.Pixbuf.new_from_data(self.img.tostring(),
GdkPixbuf.Colorspace.RGB,
False,
self.img.depth,
self.img.width,
self.img.height,
self.img.width*self.img.nChannels)
#Here my self.img is cv2.cv.iplimage object (OpenCV iplimage)我收到以下错误:
/home/jay/<ipython console> in <module>()
/usr/lib/python2.7/dist-packages/gi/module.pyc in __getattr__(self, name)
241 return registry[key]
242
--> 243 return getattr(self._introspection_module, name)
244
245 def __dir__ (self):
/usr/lib/python2.7/dist-packages/gi/module.pyc in __getattr__(self, name)
189 wrapper = info.get_value()
190 else:
--> 191 raise NotImplementedError(info)
192
193 self.__dict__[name] = wrapper
NotImplementedError: <gi.CallbackInfo object (PixbufDestroyNotify) at 0x0x8df5b6c>这里有什么问题吗?
发布于 2012-04-23 21:21:41
在PyGObject中,您不必处理DestroyNotify函数。如果在API中公开了一个,那么这就是一个bug。你应该向bugzilla.gnome.org报告。
https://stackoverflow.com/questions/10284465
复制相似问题