Python Forum

Full Version: Copying the Screen (PyGame)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
My code allows the user to create a drawing. later in the code I want to display that drawing. Is there any way that once the drawing is done I can copy the pygame display to use later, without saving the drawing to my computer. Like maybe saving it as a variable(any code available for this) :

Drawing = Whatever's on the pygame display

And later displaying that variable to the screen.
Is that possible???
Do you mean as a screenshot-like or more like redrawing it automatically (loading it)?

(Feb-11-2017, 06:04 PM)Zman350x Wrote: [ -> ]without saving the drawing to my computer.
Either way it is going to have to be saved as an image, or data somewhere on the computer to recreate the drawing.
either one works but if I were to run my code ten times would I have 10 jpg or png files on my computer or would they override each other?
They would only overwrite each other if you gave them the same file name. You would generally save them with different file names, and store those file names and what they are associated with in your program. If you need those file associations for different runs of the program, you would need to save them to file as well.
ok perfect I want them to override. can someone show me the code

Never mind I figured it out