Fills all the ROIs in this overlay with 'foreground' after clearing the the image to 'background' if it is not null.
(ImagePlus imp, Color foreground, Color background)
| 449 | /** Fills all the ROIs in this overlay with 'foreground' after clearing the |
| 450 | the image to 'background' if it is not null. */ |
| 451 | public void fill(ImagePlus imp, Color foreground, Color background) { |
| 452 | ImageProcessor ip = imp.getProcessor(); |
| 453 | if (background!=null) { |
| 454 | ip.resetRoi(); |
| 455 | ip.setColor(background); |
| 456 | ip.fillRect(0,0,ip.getWidth(),ip.getHeight()); |
| 457 | } |
| 458 | if (foreground!=null) { |
| 459 | ip.setColor(foreground); |
| 460 | for (int i=0; i<size(); i++) |
| 461 | ip.fill(get(i)); |
| 462 | ip.resetRoi(); |
| 463 | } |
| 464 | imp.updateAndDraw(); |
| 465 | } |
| 466 | |
| 467 | void setVector(Vector<Roi> v) {list = v;} |
| 468 |