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 › BeginDraw and background 204
Page Index Toggle Pages: 1
BeginDraw and background 204 (Read 429 times)
BeginDraw and background 204
May 17th, 2006, 10:45am
 
Presumably the pixels need to be initialized with some value at the beginning of each draw cycle, as I seem to remember some reference in the source code to Java getting excited if you don't.

Is this also necessary when creating the PGraphicsPDF object, or can this be overridden, so that the user determines within the draw() method precisely what will appear in the PDF file?

There are some conditions that are difficult to meet with an action script within Illustrator, that would be good to eliminate this end.

Re: BeginDraw and background 204
Reply #1 - May 17th, 2006, 12:36pm
 
i don't follow you.. there's no pixels object with pdf, so there's nothing to init on that (no loadPixels/updatePixels or anything).

however, if you create your own PGraphicsPDF, you should use beginFrame/endFrame around any drawing you do to it, which will make sure that the defaults() are set. (is that what you're asking?)

when you're done writing by hand in this manner, call dispose() on the PGraphicsPDF object.

i have new docs for this stuff but just haven't yet had time to post..
Re: BeginDraw and background 204
Reply #2 - May 17th, 2006, 11:04pm
 
Yeah, sorry I just realized the 'nope' in the PGraphicsPDF for the pixels object.

Can I prevent the defaults from doing a background(204) somewhere in the hiearchy. It seems that at least 2 background calls get made when a new PGraphicsPDF object is instantiated.

Perhaps it's best if I wait for the new docs and have a sift through the source code, just to see if what I'm asking is possible.

Thanks.

Re: BeginDraw and background 204
Reply #3 - May 17th, 2006, 11:09pm
 
k.. so you're just trying to make sure it doesn't call background? if that's all then i should just make sure that it's possible with the code. beginRecord or beginRaw might do it, but i should check because of how defaults() is called.. good to know these things as i'm working out bugs Wink
Page Index Toggle Pages: 1