Issue setting Kivy to fullscreen(问题将 Kivy 设置为全屏)
问题描述
我正在尝试编写一个全屏运行 kivy 的应用程序.但这些是我的问题:
I'm trying to write an application that runs kivy at full screen. But these are my issues:
1) 当我运行命令时:
1) When I run the command:
#Config.set('graphics', 'fullscreen', 1)
然后 kivy 似乎全时运行,但窗口的背景图像周围有很多黑色空间.即使我拉长了图像,kivy 也只是在显示时剪切了图像.
Then kivy appears to go full time, but the window has a lot of black spaces around the background image. Even if I elongate the image, kivy just cuts the image when showing it.
2) 当我运行此命令将窗口大小设置为我的屏幕大小时:
2) When I run this command to set the window size to the size of my screen:
Config.set('graphics', 'width', '1366')
Config.set('graphics', 'height', '768')
这种方式实际上给了我比全屏更好的结果,但是 kivy 返回的高度参数仅为 715 而不是 768,这是我告诉 kivy 使用的值(如您所见在上面的 Config.set() 函数中).
This way actually gives me a better result than full screen, but kivy returns a height parameter of only 715 instead of the 768, which is the value I told kivy to use (as you can see in the Config.set() function above).
我的屏幕分辨率是 1366x768
My screen resolution is 1366x768
如何解决这个问题并让我的 kivy 应用真正全屏显示?
How can I solve this issue and make my kivy app go real full screen?
非常感谢
推荐答案
试试
from kivy.core.window import Window
Window.fullscreen = True
在 App.run() 方法之前执行此操作,它应该切换到全屏模式.
Do this before you App.run() method, and it should switch to fullscreen mode.
干杯
这篇关于问题将 Kivy 设置为全屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:问题将 Kivy 设置为全屏
基础教程推荐
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- 包装空间模型 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- 求两个直方图的卷积 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
