<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 中从内存中加载图像

        时间:2023-06-07
        <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 中从内存中加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:将 OpenCV 网络摄像头集成到 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'>

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