标签:lan ref style inf imp tps span src lse
import pygame pygame.init() screen = pygame.display.set_mode((960, 600)) pygame.display.set_caption("图像变换") img = pygame.image.load(‘马.jpg‘) clock = pygame.time.Clock() img1=pygame.transform.flip(img,False, True) #图像进行水平和垂直翻转 #参数1:要翻转的图像 #参数2:水平是否翻转 #参数3:垂直是否翻转 #返回一个新图像 while True: t = clock.tick(60) for event in pygame.event.get(): if event.type == pygame.QUIT: exit() screen.blit(img1,(100,50)) pygame.display.update()
img1 = pygame.transform.scale(img, (200, 100)) #缩放 #参数2:新图像的宽高
标签:lan ref style inf imp tps span src lse
原文地址:https://www.cnblogs.com/liming19680104/p/13223908.html