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
copy and 'g' (Read 577 times)
copy and 'g'
May 20th, 2006, 7:22pm
 
Code:

PImage pimage;
void setup(){
size(200, 200);
background(0);
ellipse(width / 2, height / 2, width, height);
pimage = new PImage(width / 2, height / 2);
loadPixels();
//doesn't work ->
//pimage.copy(0, 0, width, height, 0, 0, pimage.width, pimage.height);
//does work ->
pimage.copy(g, 0, 0, width, height, 0, 0, pimage.width, pimage.height);
image(pimage, 0, 0);
}

It's a bit wierd explaining to newcomers the situation with "g". As I understood it, I was under the impression that copy() would default to the applet window when without a PImage parameter. Is this in the works to be fixed or is this operation to be done in a different fashion?
Re: copy and 'g'
Reply #1 - May 20th, 2006, 8:03pm
 
you probably need to call updatePixels().

you should *never* have to explain g to newcomers, it's only for advanced users that are doing weird things.
Re: copy and 'g'
Reply #2 - May 20th, 2006, 8:34pm
 
Code:

PImage pimage;
void setup(){
size(200, 200);
background(0);
ellipse(width / 2, height / 2, width, height);
pimage = new PImage(width / 2, height / 2);
loadPixels();
pimage.copy(0, 0, width, height, 0, 0, pimage.width, pimage.height);
pimage.updatePixels();
updatePixels();
image(pimage, 0, 0);
}

Sorry about this, I'm not getting any love from updatePixels(). I've tried dickering with the order of the commands but no combination seems to work. Using 115 on PC.
Re: copy and 'g'
Reply #3 - May 22nd, 2006, 7:03pm
 
if it looks like a bug, then please file in the bugs db with a sketch that reproduces the problem so i can look into it.
Page Index Toggle Pages: 1