1 2 3 4 5 6 7 | for ( int y = 0 ; y < getHeight(); y++) { for ( int x = 0 ; x < getWidth(); x++) { int index = x*y + x; Color c = getColorAt(x, y); pixO[index] = c; } } |
1 2 | int x = index % getWidth(); int y = index / getWidth(); |