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 & HelpPrograms › applet window resizing
Page Index Toggle Pages: 1
applet window resizing (Read 829 times)
applet window resizing
Jul 18th, 2005, 1:15pm
 
Hi,

I'm generating random pictures in an applet of size(600, 400), which fits neatly on the screen. Now I want to print some of these pictures and so need to render to a size(3000, 2000), pretty big, and bigger than my screen res. The problem is I want to see the pictures as they draw so I can choose whether I like them but I can only see a small proportion of the applet at this size. Is there a way to specify the applet window scaling i.e. size(3000, 2000, 20%) or something that would let me see a big area in a small space? Any help would be much appreciated!

Thanks,

Steve
Re: applet window resizing
Reply #1 - Jul 18th, 2005, 5:42pm
 
You could just throw in a simple key test that displays the image on the screen scaled.

the image() function will scale automatically if you specifiy

if (key == '1') {
image(source,0,0,source.width*0.20,source.height*0.20)
}

check the image syntax in the reference section.

A better key test would be a toggle function on the keyPressed() method.

where the 0.20 is the percentage you want to scale. you may have to cast them as (int), check the reference section.
Re: applet window resizing
Reply #2 - Jul 19th, 2005, 10:35am
 
That's a really good suggestion, thanks. My alternative was to run at preview size and then store all the randomly generated variables and load them back in at full res - not very elegant.

I'll give your idea a go. Cheers.
Page Index Toggle Pages: 1