I'm using pygame (version 2.0.0) to visualize big matrices interactively. I use pygame's display.set_mode function to which I pass the SCALED
flag in order to automatically scale-down the displayed image to fit the screen:
image = # a numpy 2D-array
surface = pygame.display.set_mode(image.shape, flags=pygame.SCALED)
Then, inside the event loop, I create a surfarray that resembles the numpy array, and render it using the blit function:
surfarray = pygame.surfarray.make_surface(image)
surface.blit(surfarray, (0, 0))
However, the SCALED
parameter doesn't seem to work, and pygame's window has the same size as the original image (which, in particular, is much bigger than the desktop size). Am I using the SCALED
parameter wrong?