头文件

import pygame

文档

>>> import pygame
>>> help(pygame.image)
Help on module pygame.image in pygame:

NAME
    pygame.image - pygame module for image transfer

FUNCTIONS
    frombuffer(...)
        frombuffer(string, size, format) -> Surface
        create a new Surface that shares data inside a string buffer

    fromstring(...)
        fromstring(string, size, format, flipped=False) -> Surface
        create new Surface from a string buffer

    get_extended(...)
        get_extended() -> bool
        test if extended image formats can be loaded

    load = load_extended(...)
        pygame module for image transfer

    load_basic(...)
        load(filename) -> Surface
        load(fileobj, namehint=) -> Surface
        load new image from a file

    load_extended(...)
        pygame module for image transfer

    save(...)
        save(Surface, filename) -> None
        save an image to disk

    save_extended(...)
        pygame module for image transfer

    tostring(...)
        tostring(Surface, format, flipped=False) -> string
        transfer image to string buffer

FILE
    e:\python36\lib\site-packages\pygame\image.cp36-win_amd64.pyd

接口

load()

save()

显示窗口

pygame.display.flip()

处理事件

while 1:
  # 使用event.wait来等待事件
  if pygame.event.wait().type in (QUIT, ):
    break

如果有任何问题请发邮件到 isteps@126.com


广告内容, 如果不忙, 跪求点击