display.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:ECoG-ClusterFlow 作者: sugeerth 项目源码 文件源码
def _image_to_pixbuf(self, im):  
        """
        Creates a pixbuf from an Image object.  Probably unnecessary.  In the future I could just invoke a save
        and load then png instead.

        """

        file1 = StringIO.StringIO()  
        im.save(file1, "ppm")  
        contents = file1.getvalue()  
        file1.close()  
        loader = gtk.gdk.PixbufLoader("pnm")  
        loader.write(contents, len(contents))  
        pixbuf = loader.get_pixbuf()  
        loader.close()  
        return pixbuf
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号