I'm trying to make a program that takes a screenshot of the window and then creates a pygame display with that screenshot to make it seem like the computer is frozen (It's for a 4th wall breaking game). However, when I try to do this there is a black flicker before it shows the screenshot. Is there a way to prevent this black flicker?
Edit The Code I'm Using:
im = ImageGrab.grab(bbox = (0,0,win32api.GetSystemMetrics(0),win32api.GetSystemMetrics(1)))
strFormat = 'RGB'
raw_str = im.tobytes("raw", strFormat)
tbc = pygame.image.load("TBC.png")
surface = pygame.image.fromstring(raw_str, im.size, strFormat)
surface.blit(tbc,(win32api.GetSystemMetrics(0)-tbc.get_width(),win32api.GetSystemMetrics(1)-tbc.get_height()))
fullScreen = pygame.display.set_mode((0,0),pygame.FULLSCREEN | pygame.HWSURFACE).blit(surface,(0,0))
pygame.display.update()