1

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?

Kingsley
  • 14,398
  • 5
  • 31
  • 53
snakile
  • 52,936
  • 62
  • 169
  • 241
  • 2
    According to [this example](https://github.com/pygame/pygame/blob/dac5b2e49613670f4c59ee7db06f2830e6e090ff/examples/setmodescale.py), `SCALED scales up the window for you`. They also use the `RESIZABLE` flag in conjunction. Maybe it only scales things up? Or you could try combining that flag with `RESIZABLE` and see if that works. – Random Davis Sep 15 '20 at 17:16

1 Answers1

0

According to this example, SCALED scales up the window for you. They also use the RESIZABLE flag in conjunction. Maybe it only scales things up? Or you could try combining that flag with RESIZABLE and see if that works.

Rabbid76
  • 202,892
  • 27
  • 131
  • 174