//natalia@nataliarojas.com //www.nataliarojas.com //20-oct-2003 //thanks to Oriol Quin for his icon BImage c; int tam; int currentCol; int currentFila; int cuantasFilas, cuantasColumnas; float marginX, marginY; int dirX, dirY; boolean moveX, moveY; pixel [] pixelsArr; void setup(){ size(600, 600); colorMode(RGB, 100); rectMode(CENTER_DIAMETER); noStroke(); currentCol = 0; currentFila = 0; c = loadImage("icono.jpg"); image(c, 0, 0); marginX = 180; marginY = 180; cuantasColumnas = c.width; cuantasFilas = c.height; pixelsArr = new pixel[c.width*c.height]; //armar el array con los colores for (int i=0; i1)w-=(2*acc); else w = 1; } if (currentDistY1)h-=(2*acc); else h = 1; } rect(x, y, h, w); } float distance(float x1, float y1, float x2, float y2) { return sqrt(sq(x1-x2) + sq(y1-y2)); } } void mousePressed() { marginX = mouseX; marginY = mouseY; }