2

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()
LBes
  • 3,366
  • 1
  • 32
  • 66
Twingemios
  • 61
  • 6
  • We would need to see the relevant part of the code to see how this happens. Could you provide a minimal example: https://stackoverflow.com/help/minimal-reproducible-example – Hoog Sep 13 '19 at 16:58
  • 2
    @Hoog I have added a minimal example – Twingemios Sep 13 '19 at 17:31

0 Answers0