File: RandomOvals.txt

package info (click to toggle)
imagej 1.46a-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,248 kB
  • sloc: java: 89,778; sh: 311; xml: 51; makefile: 6
file content (15 lines) | stat: -rw-r--r-- 388 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

  newImage("Untitled", "RGB", 400, 400, 1);
  width = getWidth();
  height = getHeight();
  for (i=0; i<1000; i++) {
      if (nSlices!=1) exit;
      w = random()*width/2+1;
      h = random()*width/2+1;
      x = random()*width-w/2;
      y = random()*height-h/2;
      setForegroundColor(random()*255, random()*255, random()*255);
      makeOval(x, y, w, h);
      run("Fill");
   }