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 & HelpOther Libraries › No get() for PGraphicsPDF
Page Index Toggle Pages: 1
No get() for PGraphicsPDF (Read 1159 times)
No get() for PGraphicsPDF
May 22nd, 2009, 12:49pm
 
Hi,

The sketch works fine using P2D or Java2D renderer, but when I try to write to
Code:
PDF (size(x, y, PDF, "filename.pdf") 

;
I get "No get() for PGraphicsPDF" error.
The sketch uses the PApplet's get() function, but it is always trying to find the PGraphicsPDF's get() function - even if I specify Code:
super.get(x,y) 

- , which I've seen it isn't implemented, so how can I solve this?

Thanks
Re: No get() for PGraphicsPDF
Reply #1 - May 22nd, 2009, 1:14pm
 
Well, looks clear enough: get() isn't available for this PGraphics mode, probably because it is a vector format, with no pixels to get() from.
You might have to change your algorithm, or perhaps do a double rendering, on another 2D PGraphics, to get() from there and use the result on the PDF one.
Re: No get() for PGraphicsPDF
Reply #2 - May 22nd, 2009, 2:26pm
 
Thanks PhiLho, that confirms my worst guess... so PGraphicsPDF is a vector format... but then which is the right way to render hires images (raster) bigger than screen size/resolution? Using double rendering mode (let's say P2D) and PDF(with   Code:
beginRecord() 

and Code:
endRecord() 

), am I forced to use the size specified in Code:
size(x,y) 

?? or not?

Re: No get() for PGraphicsPDF
Reply #3 - May 23rd, 2009, 12:47am
 
Barring memory issues, you can (should) create a PGraphics of wanted size (no need to display) is where you do all your drawings. You can save it later.
Re: No get() for PGraphicsPDF
Reply #4 - May 23rd, 2009, 9:49am
 
Thanks a lot PhiLho, so this is the right way to render to disk!
Code:
PGraphics pg;

void setup() {
size(100, 100);
pg = createGraphics(high-x, high-y, P3D);
}


Unluckily, I'm having java.lang.OutOfMemoryError: Java heap space error at 2000 x 2000 pixel image Sad
so, maybe should I crop the the PGraphic and save them individually... I'm into mosaics now...

thks
Re: No get() for PGraphicsPDF
Reply #5 - May 25th, 2009, 1:54am
 
If you go in the PDE to File > Preferences, you can assign more memory to Processing.
Beside, there are several threads in the forum on making big images, maybe they can be of help.
Re: No get() for PGraphicsPDF
Reply #6 - May 26th, 2009, 8:25am
 
That's great PhiLho, ! I didn't read anything about this setting yet; Things go smooth now, so thank you very much!
Page Index Toggle Pages: 1