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 › pixels[i] -> pos(x,y)
Page Index Toggle Pages: 1
pixels[i] -> pos(x,y) (Read 411 times)
pixels[i] -> pos(x,y)
Nov 18th, 2007, 12:18am
 
How could I get x and y position of a pixel from array of pixels[i]?
Thx for help!
Re: pixels[i] -> pos(x,y)
Reply #1 - Nov 18th, 2007, 12:21am
 
If you wan tot know the x/y position of a pixel which you access as pixels[i] then it's:

Code:
x=i%width;
y=i/width;
Re: pixels[i] -> pos(x,y)
Reply #2 - Nov 18th, 2007, 12:25am
 
works! THX!!!
Page Index Toggle Pages: 1