【问题标题】:Pygame fullscreen display doesn't work on TVPygame 全屏显示在电视上不起作用
【发布时间】:2019-10-15 11:22:48
【问题描述】:

我正在使用 Pygame Screen 显示全屏图像...它可以在我的显示器上运行,但是当我将树莓派连接到电视并运行代码时,它不是完全全屏的,而且有点小。

这是我使用的代码:

screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN) 
displayRes = pygame.display.get_surface()
screen.fill((0, 0, 0))
pic = pygame.image.load("standard.jpg")
screen.blit(pygame.transform.scale(pic, (int(displayRes.get_width()), int(displayRes.get_height()))), (0, 0))
pygame.display.flip()

编辑:实际上 pygame.display.get_surface() 返回错误的宽度和高度数字。当我将这些数字用于 OMXPlayer 时,它也不会全屏显示。

【问题讨论】:

标签: python raspberry-pi pygame fullscreen television


【解决方案1】:

@Kingsley 的评论让我想到了在 Raspbian 中关闭 Overscan,现在它在电视和显示器上运行良好。

为此: 打开终端 ~> 输入 sudo raspi-config ~> 高级选项 ~> 过扫描 ~> 切换到 NO ~> 重启你的树莓!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-18
    • 2019-09-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多