tileimages.pde

来自「This is processing for java examples.」· PDE 代码 · 共 40 行

PDE
40
字号
/** * Tile Images *  * Draws an image larger than the screen by tiling it into small sections. * The scaleValue variable sets amount of scaling: 1 is 100%, 2 is 200%, etc. */int scaleValue = 3;  // Multiplication factorint xoffset = 0;     // x-axis offsetint yoffset = 0;     // y-axis offsetvoid setup() {  size(600, 600);  stroke(0, 100);}void draw() {  scale(scaleValue);  translate(xoffset *(-width / scaleValue), yoffset *(-height / scaleValue));  line(10, 150, 500, 50);  line(0, 600, 600, 0);  setOffset();}void setOffset() {  save("lines-" + xoffset + "-" + yoffset + ".jpg");  xoffset++;  if (xoffset == scaleValue) {    xoffset = 0;    yoffset++;    if (yoffset == scaleValue) {      exit();    }  }  background(204);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?