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 › How to store drawing data
Page Index Toggle Pages: 1
How to store drawing data (Read 1049 times)
How to store drawing data
Dec 17th, 2008, 8:51am
 
Hi,
I have a class that is repeatedly called to create dots on the screen which gradually build up to make nice patterns or drawing on the screen.

Now, I would like to store all of these steps to replay them later so that I can use a "for" loop inside draw function to create print size images (using the image tileSaver code from Unlekker).

My question is, how can I save all of this data (in buffer?) to be played later? When I do a trace of the number of loops my drawing needs to go through before something nice appears on screen is more then 3000000 loops.

Secondly I am also interested to learn how to empty an Array?

Thanks for any help.
Re: How to store drawing data
Reply #1 - Dec 17th, 2008, 1:36pm
 
First part: I don't understand the problem. Is the drawing done with user interaction? If not, just run the sketch again. If so, just record user actions.

Second part: you can loop on the array, or use Arrays.fill(yourArray, 0);
Re: How to store drawing data
Reply #2 - Dec 18th, 2008, 9:52am
 
Hi,
I am trying to export a hi-res image using processing.

My sketch is using a class to drag recursive dots on the screen and hence in the end create some graphics.

To save this later, I am trying to use the unlekker tileSaver code (found here):
http://workshop.evolutionzone.com/2007/03/24/code-tilesaverpde/

Now the problem is, tileSaver code needs to run within the draw() function. Whereas I am drawing things outside of the draw function.

Thats why I was trying to find a way to store everything I do outside the draw() function and store it in memory and later on key press call the stored values inside draw() and repeat the steps to recreate hi-res image.

I would be interested to know if there is any other way to create hi-res images using processing.

Thanks and regards
Re: How to store drawing data
Reply #3 - Dec 18th, 2008, 12:52pm
 
you can use the draw function, even though the graphics are drawn somewhere else.

just put the tiler.pre(); in the beginning of the draw
and tiler.post(); at the end of draw.

-seltar

Re: How to store drawing data
Reply #4 - Dec 19th, 2008, 7:27am
 
Thanks,it kind of works now but with a small issue.

I can export large image but the large image consists of tile of small images instead of one large image.

btw. I am using P3D and not OPENGL.

When I change P3D to OPENGL in my code, the screen just keeps flickering with garbage .... any idea how to solve this?

Thanks again.
Re: How to store drawing data
Reply #5 - Jan 16th, 2009, 3:23pm
 
hi,
still struggling with this one.

now i have two questions instead.
first one is still about exporting hi-resolution images from processing.
So when I use tilesaver, I understand that the draw() function has to have a background() call. If I keep drawing without calling the background, the tilesaver does not work Sad

Secondly, it only works with opengl, so i would really love to use opengl for all my sketches instead of P3D, but when I run the code using opengl, the sketch plays in a weired manner. (I am on windows machine with Vista home edition).

Any suggestions?
Page Index Toggle Pages: 1