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 › Can you setSize without clearing the screen
Page Index Toggle Pages: 1
Can you setSize without clearing the screen? (Read 331 times)
Can you setSize without clearing the screen?
Feb 2nd, 2009, 10:59pm
 
I want to use frame.setSize(x,y) to resize the screen size on the go (when the user clicks a button), but I don't want the screen to be cleared when I do it, which is what happens when you use frame.setSize().

I want the screen contents to be preserved no matter how I resize the screen. Is this possible?

Re: Can you setSize without clearing the screen?
Reply #1 - Feb 3rd, 2009, 12:55am
 
Yes. get() the screen content, and after resize, just image() it.
Re: Can you setSize without clearing the screen?
Reply #2 - Feb 3rd, 2009, 7:31am
 
OK I have tried that and it does not work. The screen still gets cleared.

I have done this :-

Code:

PImage sc;
sc = get();
frame.setSize(650,250);
image (sc, 0, 0);


and yet the screen still gets cleared after the setSize command.
Re: Can you setSize without clearing the screen?
Reply #3 - Feb 3rd, 2009, 7:37am
 
OK I have worked it out. I need to put a size command after the setSize for it to work. Like this :-

Code:

PImage sc;
sc = get();
frame.setSize(650,250);
size (650, 250);
image (sc, 0, 0);



Thanks for your help.
Page Index Toggle Pages: 1