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.
Page Index Toggle Pages: 1
images (Read 589 times)
images
May 9th, 2006, 5:17pm
 
Is there a way to use images in your processing program that have been taken from the program,ie saveFrame and put it back in as loadImage--from what I found you can only save it in .tif, but you can only load in .gif or .jpg.

thanks!
Re: images
Reply #1 - May 9th, 2006, 9:29pm
 
you can also save and load targa files (.tga)

However, (using v 114, OS X) saved targa format not recognized on way back in. Anyone able to get this to work?
Re: images
Reply #2 - May 11th, 2006, 7:17pm
 
Well the update solved that problem! Thank you--
I was wondering if anyone knows how to get around this:
I am capturing the image created by the program at mousePressed and feeding it back in as the background at mouseReleased, however, even though mousePressed comes first, it says that the image doesnt exist yet when it's supposed to be fed back in. Is there a way to slow it down, or a better way of feeding it back in other than using mouseReleased? Can you say mousePressed two times or something?
thanks!
Re: images
Reply #3 - May 11th, 2006, 8:21pm
 
try this:

Code:

PImage bg;

void setup() {
size(400, 400, P3D);
bg = new PImage(width, height);
stroke(255);
}


void draw() {
background(bg);
line(width/2, height/2 , mouseX, mouseY);
}


void mousePressed() {
bg.copy(g, 0,0,width,height,0,0,width,height);
}



obviously if you move the background(bg) to void mouseReleased() it'll do exactly as you asked, but for this demonstration nothing would really be visible doing it that way.
Page Index Toggle Pages: 1