<small id='Qjv3d'></small><noframes id='Qjv3d'>

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

      1. <legend id='Qjv3d'><style id='Qjv3d'><dir id='Qjv3d'><q id='Qjv3d'></q></dir></style></legend>
          <bdo id='Qjv3d'></bdo><ul id='Qjv3d'></ul>

        .gif 图像作为源代码在 Windows kivy 程序中运行良好

        时间:2023-08-31

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

          <small id='Xi9mf'></small><noframes id='Xi9mf'>

                • <bdo id='Xi9mf'></bdo><ul id='Xi9mf'></ul>

                    <tbody id='Xi9mf'></tbody>

                  本文介绍了.gif 图像作为源代码在 Windows kivy 程序中运行良好.通过 kivy Launcher 运行显示 gif 图像的背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在运行一个程序,我在小部件中显示一个 .gif 图像,它运行良好但是当我使用 kivy 启动器运行这个应用程序时,即使图像没有背景,.gif 图像也会带有一个方形框.

                  I am running a program where i am showing a .gif image in a widget and it works perfectly well however when i run this app using kivy launcher the .gif image comes with a square box even when the Image is without a backgrund .

                  任何人都有任何想法,为什么这在 android 和 windows 上表现不同.

                  Any one any ideas , why this is behaving differently on android and windows .

                  请参阅下面的 .kv 代码作为我如何使用 .gif 图像的示例.我将此 .gif 图像用作按钮.

                  Please see below .kv code as an example of how i used .gif image . I am using this .gif image as a button .

                  <ButImage@ButtonBehavior+AsyncImage>
                      canvas.before:
                          Color:
                              rgb: (0, 0, 1)
                          PushMatrix
                          Rotate:
                              axis: 0,0,1
                              angle: 20
                              origin: self.center
                      source: "images/butterflybluex.gif"
                      canvas.after:
                          PopMatrix
                  

                  ...

                  推荐答案

                  首先确保你打包了 pil/pillow [只需将它添加到构建 apk 的要求之一] 用于 gif 加载,否则是一个纯 python 加载器使用android会很慢,第二请详细说明您所说的方框是什么意思?

                  First make sure that you package pil/pillow [just add it to one of the requirements while building the apk] for gif loading, otherwise a pure python loader that is very slow for android would be used, Second please elaborate what you mean by the square box?

                  更新:您更新后的示例显示您正在使用 AsyncImage 与本地源,Async Image 是要与远程 url 一起用于本地源您可以只使用 Image 类.

                  Update: your updated example shows that you are using AsyncImage with a local source, Async Image is ment to be used with a remote url for local sources you can just use a Image class.

                  第二:如果你得到的是白色背景而不是图像,那么你给了它错误的路径.确保您的图像存在于目录中,或者您的目录存在于启动器的正确位置.

                  Second: If you are getting a white background instead of a image you gave it the wrong path. Make sure your image is present in the directory or that your directory is present in the right place on the launcher.

                  更新 3:如前所述,问题在于使用 pil 的 gif 图像加载器.并非所有图像都可以使用它.它适用于您的桌面,因为没有安装 pil,而是使用纯 python gif 加载器.由于速度问题,此加载程序无法在 android 上使用.

                  Update 3: The issue as stated earlier is with gif image loader using pil. Not all images work with it. It works on your desktop cause pil isn't installed and a pure python gif loader is used instead. This loader would not be usable on android cause of speed issues.

                  一种解决方法是使用 gimp 打开并保存图像.那么它应该可以正常工作.另一种方法是贡献和修复:使用 pil 用于 gif 的加载器......(我必须警告网络上有很多不同的 gif,每个都有自己的细微变化.确保一个作品会导致其他作品被破坏.)

                  One workaround is to use gimp to open and save the image. It should work properly then. One other way is to contribute and fix: the loader using pil for gif...(I must warn there are so many different gifs on web each with their own slightly changes. Making sure one works would lead to others getting broken.)

                  要在桌面上重现您的问题,只需安装枕头.

                  To reproduce your issue on desktop just install pillow.

                  在使用 gif 制作动画时可能会出现许多工件,我建议您在 .zip 中使用 images(png/jpg...) 并将其设置为源代码.这样您就可以摆脱伪影了.

                  There are many artifacts that can come up while using gifs for animation, I'd recommend you use images(png/jpg...) in a .zip and set that to the source. That way you get rid of the artifacts.

                  请确保 Image 类提供的 gif 或 .zip 动画仅用于不需要大量控制动画的情况.就像不会改变的静态动画一样.

                  Please make sure that gif or .zip animation provided by the Image class, is only used for situations where you don't need to control the animation a lot. Like for static animations that don't change.

                  如果您的动画需要超出此范围,那么您应该通过在 Atlas 中加载精灵表来手动管理动画.

                  If your animations needs go beyond this then you should manage your animation manually by loading a sprite sheet in a Atlas.

                  这篇关于.gif 图像作为源代码在 Windows kivy 程序中运行良好.通过 kivy Launcher 运行显示 gif 图像的背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何在 kivy 中播放来自网络的视频,例如 youtub 下一篇:在 Swift 中从字符串到 NSDate

                  相关文章

                  最新文章

                  <legend id='b0GZ7'><style id='b0GZ7'><dir id='b0GZ7'><q id='b0GZ7'></q></dir></style></legend>
                    <bdo id='b0GZ7'></bdo><ul id='b0GZ7'></ul>
                • <i id='b0GZ7'><tr id='b0GZ7'><dt id='b0GZ7'><q id='b0GZ7'><span id='b0GZ7'><b id='b0GZ7'><form id='b0GZ7'><ins id='b0GZ7'></ins><ul id='b0GZ7'></ul><sub id='b0GZ7'></sub></form><legend id='b0GZ7'></legend><bdo id='b0GZ7'><pre id='b0GZ7'><center id='b0GZ7'></center></pre></bdo></b><th id='b0GZ7'></th></span></q></dt></tr></i><div id='b0GZ7'><tfoot id='b0GZ7'></tfoot><dl id='b0GZ7'><fieldset id='b0GZ7'></fieldset></dl></div>
                • <tfoot id='b0GZ7'></tfoot>
                  1. <small id='b0GZ7'></small><noframes id='b0GZ7'>