<legend id='ClvFE'><style id='ClvFE'><dir id='ClvFE'><q id='ClvFE'></q></dir></style></legend>
    • <bdo id='ClvFE'></bdo><ul id='ClvFE'></ul>

  • <small id='ClvFE'></small><noframes id='ClvFE'>

  • <i id='ClvFE'><tr id='ClvFE'><dt id='ClvFE'><q id='ClvFE'><span id='ClvFE'><b id='ClvFE'><form id='ClvFE'><ins id='ClvFE'></ins><ul id='ClvFE'></ul><sub id='ClvFE'></sub></form><legend id='ClvFE'></legend><bdo id='ClvFE'><pre id='ClvFE'><center id='ClvFE'></center></pre></bdo></b><th id='ClvFE'></th></span></q></dt></tr></i><div id='ClvFE'><tfoot id='ClvFE'></tfoot><dl id='ClvFE'><fieldset id='ClvFE'></fieldset></dl></div>

      <tfoot id='ClvFE'></tfoot>

        在 Kivy 中从内存中加载图像

        Load image from memory in Kivy(在 Kivy 中从内存中加载图像)
        <legend id='FJqeY'><style id='FJqeY'><dir id='FJqeY'><q id='FJqeY'></q></dir></style></legend>
        <i id='FJqeY'><tr id='FJqeY'><dt id='FJqeY'><q id='FJqeY'><span id='FJqeY'><b id='FJqeY'><form id='FJqeY'><ins id='FJqeY'></ins><ul id='FJqeY'></ul><sub id='FJqeY'></sub></form><legend id='FJqeY'></legend><bdo id='FJqeY'><pre id='FJqeY'><center id='FJqeY'></center></pre></bdo></b><th id='FJqeY'></th></span></q></dt></tr></i><div id='FJqeY'><tfoot id='FJqeY'></tfoot><dl id='FJqeY'><fieldset id='FJqeY'></fieldset></dl></div>

        1. <tfoot id='FJqeY'></tfoot>

              <tbody id='FJqeY'></tbody>

          1. <small id='FJqeY'></small><noframes id='FJqeY'>

                <bdo id='FJqeY'></bdo><ul id='FJqeY'></ul>
                  本文介绍了在 Kivy 中从内存中加载图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在内存中有一张图片格式(从pyplot输出),我想通过Kivy直接在Android上显示它,但我不想创建图片文件.有没有办法做到这一点?在 pyplot 上,我可以通过将对象写入对象来生成类似对象的文件,但我不知道如何将其放入 Kivy.

                  I have a picture in memory a format (output from pyplot) and I want to directly show it on the Android through Kivy, but I don't want to create a picture file. Is there any way to do this? On pyplot I am able to generate the file like object by writing it the object, but I don't know how to put it into Kivy.

                  推荐答案

                  您可以使用 StringIO 将文件保存到缓冲区中(参见:Python中的二进制缓冲区).

                  You could save the file into a buffer with StringIO (see this: Binary buffer in Python).

                  类似:

                  from StringIO import StringIO
                  buff = StringIO()
                  plt.savefig(buff)
                  buff.seek(0)
                  from kivy.core.image.img_pygame import ImageLoaderPygame
                  imgdata = ImageLoaderPygame(buff)._data
                  

                  这篇关于在 Kivy 中从内存中加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Kivy 1.9.0 Windows package KeyError: #39;rthooks#39;(Kivy 1.9.0 Windows 包 KeyError: rthooks)
                  Python Kivy: how to call a function on button click?(Python Kivy:如何在按钮单击时调用函数?)
                  How to disable a widget in Kivy?(如何禁用 Kivy 中的小部件?)
                  Centering an object in Kivy(在 Kivy 中将对象居中)
                  How to downgrade to Python 3.4 from 3.5(如何从 Python 3.5 降级到 Python 3.4)
                  Change button or label text color in kivy(在kivy中更改按钮或标签文本颜色)

                  <i id='8XukW'><tr id='8XukW'><dt id='8XukW'><q id='8XukW'><span id='8XukW'><b id='8XukW'><form id='8XukW'><ins id='8XukW'></ins><ul id='8XukW'></ul><sub id='8XukW'></sub></form><legend id='8XukW'></legend><bdo id='8XukW'><pre id='8XukW'><center id='8XukW'></center></pre></bdo></b><th id='8XukW'></th></span></q></dt></tr></i><div id='8XukW'><tfoot id='8XukW'></tfoot><dl id='8XukW'><fieldset id='8XukW'></fieldset></dl></div>

                  <legend id='8XukW'><style id='8XukW'><dir id='8XukW'><q id='8XukW'></q></dir></style></legend>
                  <tfoot id='8XukW'></tfoot>

                    <small id='8XukW'></small><noframes id='8XukW'>

                      <tbody id='8XukW'></tbody>
                      <bdo id='8XukW'></bdo><ul id='8XukW'></ul>