Answers for "take screen shot of pygame display"

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
0

how to make a screen in pygame

so here i will be giving the most basic and most easy method

import pygame
# initialize pygame
pygame.init()
screen = pygame.display.set_mode((1370, 710))
#1370,710 gives a full screen
Posted by: Guest on June-09-2021

Python Answers by Framework

Browse Popular Code Answers by Language