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

  • Post author:
  • Post category:其他






1. pygame.transform.


flip

(

Surface, xbool, ybool

)  (水平和垂直翻转)


xbool => True 为水平翻转



ybool

=> True 为垂直翻转


return

Surface





2.

pygame.transform.


scale(

Surface, (width, height), DestSurface = None

)(

缩放)




(width, height)


: 缩放的大小


return

Surface









3. pygame.transform.


rotate

(

Surface, angle

) (

旋转

)



angle

: 旋转角度


return

Surface




______________________________________________________________








模块:  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




版权声明:本文为wenxxxxx原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。