猕猴桃改变图像的纹理给黑色图像

时间:2018-11-02 10:47:02

标签: python 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

Before

更改纹理之前

After

更改纹理后^

有人可以帮我吗?

0 个答案:

没有答案