简体   繁体   中英

Defining a screen in PyGame and not show it

I'm writing a script on PyGame that should create an image and save it, not show it. The process of generating and saving is perfect, but when I use myscreen = pygame.display.set_mode([500,500]) , it causes a windows to be open, on the size I'm defining. Once I'm not giving any pygame.display.flip() the window just blinks, appear and dissapear.

I would like to know if there is a way to initialize a screen in PyGame and not show it, so, I could create my image and just save it.

Don't use display to create it. You can just construct a Surface and use it in conjunction with image.save() to save it, or use something like Pillow to create an image without using PyGame at all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM