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 › draw rectangular
Page Index Toggle Pages: 1
draw rectangular (Read 345 times)
draw rectangular
Feb 10th, 2009, 3:22am
 
I was wondering if using processing can let user drag the mouse to paint a rectangular, just as how to draw a rectangular in the painter program in windows.

As the mouse is dragging, an rectangular is rendered and updated instantly as the mouse moving for user's real-time preview. This should not influence other part in the canvas.

I tried to do that in the draw function. But all other part will be deleted as well. Can anyone shed some light it? Thanks.
Re: draw rectangular
Reply #1 - Feb 10th, 2009, 7:29am
 
There are probably a few ways to do this.

Was your plan to just change a picture (like in Paint) or to have objects that you could move later?
Re: draw rectangular
Reply #2 - Feb 10th, 2009, 10:41am
 
A possible way is to get() the image at the start of the operation, then on each draw() call, image() it back to display and draw the rectangle.
Page Index Toggle Pages: 1