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 › circleArray[x] of pixels[i]
Page Index Toggle Pages: 1
circleArray[x] of pixels[i] (Read 414 times)
circleArray[x] of pixels[i]
Nov 18th, 2007, 6:44pm
 
I need to get pixels[i] from a picture, but only pixels in a shape of a circle around the mouse (mouseX,mouseY).

If you can imagine, I need to get index of every pixel (in some distance from) around the mouse.

Any help?
Thank you
Re: circleArray[x] of pixels[i]
Reply #1 - Nov 19th, 2007, 9:05pm
 
well, you could simply measure the distance of every pixel to the mouse.
dist(x,y,mouseX,mouseY);
If it's smaller than the radius of your circle, that pixel belongs into the circleArray.

however, I can't think of many cases this would make sense. If you want just something like an ellipse following your mouse, you'll be better off drawing an ellipse at mouse position. what do you want to do?
Re: circleArray[x] of pixels[i]
Reply #2 - Nov 19th, 2007, 10:09pm
 
First of all thanx for your reply. I already found the solution. I have many pictures in as many layers. When user drags mouse over picture i have to delete the upper picture and show the picture under that picture. And so on and on and on... that is what I'm doing and have done:)

Page Index Toggle Pages: 1