Answers for "save screenshot of screen in pygame"

1

save screenshot of screen in pygame

rect = pygame.Rect(25, 25, 100, 50)
sub = screen.subsurface(rect)
pygame.image.save(sub, "screenshot.jpg")
#The saved portion of the screen will be the rect portion
Posted by: Guest on July-25-2021

Python Answers by Framework

Browse Popular Code Answers by Language