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 › Best way to scale up / resize an image
Page Index Toggle Pages: 1
Best way to scale up / resize an image (Read 731 times)
Best way to scale up / resize an image
Apr 11th, 2007, 3:57am
 
This may be a simple question but I'm wondering how to scale up an image, resizing it so that it is bigger than the original resolution.  I wasn't able to find any information on this elsewhere.

The closest thing I could find was this:

currentCam = loadImage("http://209.178.198.74/ec_metros/ourcams/washingtondc.jpg");
currentCam.copy(0, 0, currentCam.width, currentCam.height, 0, 0, width, height);
image(currentCam, 0, 0);

I'm trying to scale this 320 x 240 image up to 640 x 480.  It doesn't work, only displaying the top left corner of the image.  I believe this is because as the image scales up, the original array of colors for the image can not hold the larger image size.  

Is there any easy way to scale up an image?
Re: Best way to scale up / resize an image
Reply #1 - Apr 11th, 2007, 9:17am
 
try:

Code:
 currentCam = loadImage("http://209.178.198.74/ec_metros/ourcams/washingtondc.jpg");
image(currentCam,0,0,640,480);
Re: Best way to scale up / resize an image
Reply #2 - Apr 11th, 2007, 8:23pm
 
Oh man - thanks - this was driving me crazy.  How foolish of me!
Page Index Toggle Pages: 1