Pygame学习(3)-----如何对图像进行翻转,缩放,旋转


1. pygame.transform.flip(Surface, xbool, ybool)  (水平和垂直翻转)

     xbool => True 为水平翻转

     ybool => True 为垂直翻转

     return Surface


2.  pygame.transform.scale(Surface, (width, height), DestSurface = None)(缩放)

   (width, height): 缩放的大小

    returnSurface


3. pygame.transform.rotate(Surface, angle) (旋转)

     angle : 旋转角度

     returnSurface

______________________________________________________________


模块:  pygame.transform

功能: 对图像进行缩放和移动

其他函数:

4.pygame.transform.rotozoom(urface, angle, scale)(经过滤波的缩放和旋转)

5.pygame.transform.scale2x(Surface, DestSurface = None) (特殊的图像2倍放大)

6.pygame.transform.smoothscale(Surface, (width, height), DestSurface = None) (平滑缩放任意大小)

7.pygame.transform.chop(Surface, rect) (图像剪切)

8.pygame.transform.laplacian(Surface, DestSurface = None) (描边)

9.pygame.transform.average_surfaces(Surfaces, DestSurface = None, palette_colors = 1)

10.pygame.transform.average_color(Surface, Rect = None)

11.pygame.transform.threshold(DestSurface, Surface, color, threshold = (0,0,0,0), diff_color = (0,0,0,0), change_return = 1, Surface = None, inverse = False)


以上 return Surface


12.pygame.transform.get_smoothscale_backend() (返回smoothscale过滤版本)

return string

13.pygame.transform.set_smoothscale_backend(type) (设置smoothscale过滤版本)

return None



  • 13
    点赞
  • 61
    收藏
    觉得还不错? 一键收藏
  • 7
    评论
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值