Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Kivy改变图像纹理得到黑色图像_Python_Kivy - Fatal编程技术网

Python Kivy改变图像纹理得到黑色图像

Python Kivy改变图像纹理得到黑色图像,python,kivy,Python,Kivy,Kivy在更改Image.texture后,给出黑色效果 我的代码: self.ids['profimage'].source = './add_photo.png' 几行之后 pimg = Image.open(bio).convert('RGB') # bio is a valid _io.BytesIO object with image data pimg = pimg.crop((0, 0, int(self.width*0.3), int(self.width*0.3))) pim

Kivy在更改Image.texture后,给出黑色效果

我的代码:

self.ids['profimage'].source = './add_photo.png'
几行之后

pimg = Image.open(bio).convert('RGB') # bio is a valid _io.BytesIO object with image data
pimg = pimg.crop((0, 0, int(self.width*0.3), int(self.width*0.3)))
pimg.save(data, format='png')
data.seek(0)
im = CoreImage(BytesIO(data.read()), ext='png')
self.ids['profimage'].texture = im.texture

在改变纹理之前^

改变纹理后^

有人能帮我吗