我想要旋转一张图片并且保持边缘的平滑。
这是原始图片的样子:
旋转后的图片如下:
我使用的代码如下:
(这里保留了HTML标签)
这是原始图片的样子:
![original image](https://istack.dev59.com/PjjCA.webp)
![rotated image](https://istack.dev59.com/ax7Wi.webp)
def rot_center(self, image, angle):
"""rotate an image while keeping its center and size"""
orig_rect = image.get_rect()
rot_image = pygame.transform.rotate(image, angle)
rot_rect = orig_rect.copy()
rot_rect.center = rot_image.get_rect().center
rot_image = rot_image.subsurface(rot_rect).copy()
return rot_image
我做错了什么吗?
(这里保留了HTML标签)