mr.*_*Shu 4 python pygame smooth image
我想旋转图像并保持边缘光滑。
看起来像这样
旋转后
我正在使用的代码如下所示
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
Run Code Online (Sandbox Code Playgroud)
我做错了什么吗?