Get Loc Pixels[] 640*480?
in
Contributed Library Questions
•
2 years ago
Hello folks,
Sorry for the wacky title but i couldn't think of a better one. First time poster so go easy :)
From the tutorials ( http://processing.org/learning/pixels/) i understand how to get the location of a pixel using x/y-coordinates but what to do when you have unequal dimensions?
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
int loc = x + y * width;
}
Sorry for the wacky title but i couldn't think of a better one. First time poster so go easy :)
From the tutorials ( http://processing.org/learning/pixels/) i understand how to get the location of a pixel using x/y-coordinates but what to do when you have unequal dimensions?
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
int loc = x + y * width;
}
}
Thanks in advance,
FRid
1