Frame buffer module of python

后端 未结 1 1718
北恋
北恋 2020-12-31 20:56

I\'m looking for a python module which can display jpg or png file to /dev/fb0 directly.

I hope the the module can call and di

相关标签:
1条回答
  • 2020-12-31 21:48

    Maybe you may use pygame.

    http://www.pygame.org/wiki/about

    Pygame uses either opengl, directx, windib, X11, linux frame buffer, and many other different backends...

    UPDATE: Simple example:

    import pygame
    import sys
    import time
    
    pygame.init()
    
    size = (pygame.display.Info().current_w, pygame.display.Info().current_h)
    black = 0, 0, 0
    
    screen = pygame.display.set_mode(size)
    
    ball = pygame.image.load("ball.gif")
    ballrect = ball.get_rect()
    
    screen.fill(black)
    screen.blit(ball, ballrect)
    pygame.display.flip()
    
    time.sleep(5)
    

    Run:

    SDL_NOMOUSE=1 python ./ball.py
    
    0 讨论(0)
提交回复
热议问题