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 › application background copy to PImage?
Page Index Toggle Pages: 1
application background copy to PImage?? (Read 328 times)
application background copy to PImage??
Aug 27th, 2008, 7:30am
 
Hello

I am adding some shapes and strokes to my background. I want to copy its canvas/graphics into a PImage. how it is possible to make it?

PImage backgroundCopy;
void setup()
 {
   size(300,300);
   backgroundCopy = createImage(width,height,RGB);
 }
 
void draw()
 {
   background(0);
   stroke(255);
   line(0,0,width,height);
   
   // backgroundCopy = copy background???? how?!?!?!?!
   // applyEffect();
 }
 
void applyEffect()
 {
   for (int i=0;i<backgroundCopy.width*backgroundCopy.height;i++)
     {
//        apply some effect here
     }
 }
Re: application background copy to PImage??
Reply #1 - Aug 27th, 2008, 11:03am
 
http://processing.org/reference/get_.html

backgroundCopy=get();
Re: application background copy to PImage??
Reply #2 - Aug 27th, 2008, 8:06pm
 
Quote:
http://processing.org/reference/get_.html

backgroundCopy=get();



thank you i will test it : )
Page Index Toggle Pages: 1