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 › PGraphics.copy().pixels
Page Index Toggle Pages: 1
PGraphics.copy().pixels (Read 695 times)
PGraphics.copy().pixels
Aug 23rd, 2005, 4:00pm
 
I haven't really dug into the p55 beta yet so I thought I'd give it a go and start rewriting some of my p55 alpha sketches.

Now I used to do something like:
Code:
BGraphics gTmp = new BGraphics(iWdt,iHgt);
// do some drawing into gTmp
// then put the BGraphics into a BImage
BImage eAlp = new BImage(gTmp.copy().pixels,iWdt,iHgt,ALPHA);


In beta this would be:
Code:
PGraphics gTmp = new PGraphics(iWdt,iHgt,null);
gTmp.defaults();
// do some drawing into gTmp
// then put the PGraphics into a PImage
PImage eAlp = new PImage(gTmp.copy().pixels,iWdt,iHgt,ALPHA);


But I get an error on the copy() in that last line. I'm not sure what to do about it. Might it have something to do with this copy bug?: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1119220575;start=0#0
Re: PGraphics.copy().pixels
Reply #1 - Aug 27th, 2005, 7:04pm
 
that bug was fixed in 92 so if you're using 92 and still seeing the problem, then it's not the same.

what was the error? several red lines in the console? the code didn't compile? your machine lit on fire?

i'm not quite sure what you're trying to do with that code.. if you just want a copy of the PGraphics, then use:

PGraphics eAlp = gTmp.copy();

and then set it to alpha using

eAlp.format = ALPHA;

other than that i can't guess what the error would be.
Re: PGraphics.copy().pixels
Reply #2 - Aug 28th, 2005, 9:08am
 
thanks... that'll help
Yeah ... was just trying to copy the pixel data from gTemp.
I just checked... and I'm using 91... now downloading 92.
The download page has 91 as main download and 92 is in the previous releases, is that right?
Re: PGraphics.copy().pixels
Reply #3 - Aug 28th, 2005, 2:45pm
 
yeah, 92 didn't receive proper testing before release so it hasn't been made the "official" release yet and probably won't.. i only make a release the default once things seem to be ok, but i think we'll just go straight to 93 instead.
Page Index Toggle Pages: 1