Kivy 从memory 读取image
Posted jeroen
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Kivy 从memory 读取image相关的知识,希望对你有一定的参考价值。
借助PIL来处理的图片数据
fp = BytesIO() img = Image.frombytes(‘RGB‘, img_size, buf_bytes, ‘raw‘, ‘BGR;16‘, 0, 1) img.save(fp, ‘png‘) return fp.getvalue()
之后,用kivy.core.image.Image处理数据
self.texture = CoreImage(BytesIO(data), ext = ‘png‘).texture
以上是关于Kivy 从memory 读取image的主要内容,如果未能解决你的问题,请参考以下文章