http://i43.tinypic.com/dpfnuo.png
//toolkit needed for beep() (see BeepDemo)
import java.awt.Toolkit; //added 2012-03-09
int cellsize= 40;
int gridsize = 9;
int fullsize = cellsize*gridsize+1;
int dblsize = 2*(cellsize*gridsize)+cellsize+1;
int savedImageCount=0;
boolean dot1On=true; // 1x1 dot in center
boolean dot2On=false; // 3x3 box in center
boolean dot3On=false; // 5x5 box in center
boolean coordOn=true; // coord num in each cell (TODO...)
PFont fontA;
void setup() {
background(255);
size(dblsize, dblsize);
smooth();
fontA = loadFont("Ebrima-10.vlw");
textFont(fontA);
textAlign(LEFT,TOP);
// text("",x,y);
}
void draw() {
for (int r=0; r <= 1; r++) {
int rr=r*(cellsize*(gridsize+1));
for (int c=0; c <= 1; c++) {
int cc=c*(cellsize*(gridsize+1));
for (int y=0; y < gridsize; y++) {
int yy=y*cellsize;
for (int i=0; i < gridsize; i++) {
int ii=i*cellsize;
//fill(211,228,255);
fill(255, 255, 255);
stroke(0, 0, 0);
rect(rr+yy, cc+ii, cellsize, cellsize);
if (dot3On) rect(rr+yy+cellsize/2-2, cc+ii+cellsize/2-2, 4, 4);
if (dot2On) rect(rr+yy+cellsize/2-1, cc+ii+cellsize/2-1, 2, 2);
if (dot1On) point(rr+yy+cellsize/2, cc+ii+cellsize/2);
fill(0,0,0);
if (coordOn) text((i+1)+""+(y+1),rr+yy+2,cc+ii-1);
}
}
}
}
}//draw()
//======================================================================
void keyPressed() {
Toolkit.getDefaultToolkit().beep();
saveFrame("PS1_05image.png");
}
//======================================================================
void mousePressed() {
//to save image on mouse_right_click
boolean mouseRight=(mouseButton==RIGHT);
boolean mouseLeft=(mouseButton==LEFT);
if (mouseRight) {
Toolkit.getDefaultToolkit().beep();
String save_time=nf(year()00, 2)+nf(month(), 2)+nf(day(), 2)+"-"+nf(hour(), 2)+nf(minute(), 2)+nf(second(), 2);
savedImageCount++;
save("mP-"+save_time+".png");
println("SAVED: mP "+save_time+".png");
}
else if (mouseLeft) {
}
}//mousePressed()

fullscreen
