"""
按鼠标滚轮缩放图像pygame示例
"""
import pygame
from pygame.locals import *
width,height = 680,660
pos = width//2,height//2
image = 'beauty.jpg'
screen = pygame.display.set_mode((width,height))
pygame.display.set_caption("按鼠标滚轮缩放图像pygame示例 www.lixingqiu.com")
w,h = image.get_width(),image.get_height()
k = h/w # 高度和宽度之比
step = 10
running = True
while running:
for event in pygame.event.get():
if event.type == QUIT:running = False
screen.fill((0,0,0))
screen.blit(image2,rect)
pygame.display.update()
pygame.quit()
下载完整源代码与素材,请
需要浏览更多吗?
成为会员后,登陆才能继续浏览!联系微信scratch8即可办理会员。
(会员专属:能浏览所有文章,下载所有带链接的Python资源。)

