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 & HelpPrograms › Fast image drawing
Page Index Toggle Pages: 1
Fast image drawing (Read 308 times)
Fast image drawing
Feb 8th, 2009, 9:35pm
 
I need to very precisely control the rate at which images are drawn.  Think something along the lines of subliminal messages -- a very brief flash.

Ideally, I need something in the 10ms range (so 100 FPS).  But this really needs only to occur for a single frame (so 10ms of one image, 990ms of another).  

I've tried boosting the FPS count, but that doesn't work reliably.

I also tried the following:

image(IMAGEONE, 0, 0);
delay(100);
image(IMAGETWO, 0, 0);

But that never seems to render the first image, no matter how long I make the delay.  I have a suspicion this is because it's rendering to the frame buffer (processing is double buffered by default I assume), so everything appears all at once when draw() returns.

I'm hoping someone has some ideas on how to do very quick "flashes" of images.

Help much appreciated,
Chris
Re: Fast image drawing
Reply #1 - Feb 9th, 2009, 3:39am
 
You might try using a frame counter incremented each draw cycle. Whenever (framecount % 100 == 0), draw one image, else draw the other.
Page Index Toggle Pages: 1