We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › how to save the frame in a variable?
Page Index Toggle Pages: 1
how to save the frame in a variable?? (Read 366 times)
how to save the frame in a variable??
Apr 7th, 2008, 4:01pm
 
Hello everybody,

I need to save my frame in a variable! I already try with the fonction saveFrame() but it save my frame as a file (myframe.jpg for example)
The problem; its very slow and I don't can export my programm!

Has some body a solution for this problem please! Thanks
Re: how to save the frame in a variable??
Reply #1 - Apr 7th, 2008, 5:26pm
 
Maybe you can describe why you wanna do that. Do you wanna store a copy of screen as PGraphic object? By the way this will truly slow done if you do this in every frame.
Re: how to save the frame in a variable??
Reply #2 - Apr 7th, 2008, 7:36pm
 
I want that for a drawingpogramm!

When you clic and move the mouse the cursor draw on the picture and when you release the mouse the picture is saved to reload later in the programm! SO with the frameSave() application all was good. I save the picture on a name and I can reload with loadImage()

The problem is that its not allowed to save the frame on a other file when we later export! I need to save the frame juste in a variable of the programm!
With PGraphics should be a solution but I can't find how to save the frame on a variable and how to load it later!

I try it too with loadPixel and pixels but nothings is saved with this solution!

Do you have an other possibility??

Thanks
Re: how to save the frame in a variable??
Reply #3 - Apr 7th, 2008, 7:53pm
 
PImage save=get();

That'll put the current screen contents into a PImage which you can later put back onto the screen or whatever you want.
Re: how to save the frame in a variable??
Reply #4 - Apr 7th, 2008, 8:04pm
 
thanks I try it now!!
Page Index Toggle Pages: 1