/** Sets current foreground color. */ public void setColor(Color c) { if (ip!=null) ip.setColor(c); }
/** Sets current foreground color. */ public void setColor(Color c) { if (ip!=null) ip.setColor(c); }
public void redrawGrid(){ if(ip != null){ drawAxesTicksGridNumbers(steps); ip.setColor(Color.black); } }
public void redrawGrid(){ if(ip != null){ drawAxesTicksGridNumbers(steps); ip.setColor(Color.black); } }
public void drawNY(int file, int mod) { int xOffs = xIndent + (mod+1) * colW; int yOffs = strIndent + yIndent + (file+1) * rowH; int r = (rowH-5)/2; int cx = xOffs + colW / 2; int cy = yOffs + rowH / 2; ip.setColor(Color.GRAY); ip.fillOval(cx - r, cy - r, 2*r, 2*r); ip.setColor(Color.BLACK); ip.drawOval(cx - r, cy - r, 2*r, 2*r); }
private void label(ImageProcessor ip, String msg, Color color) { int size = getHeight()/20; if (size<9) size=9; Font font = new Font("Helvetica", Font.PLAIN, size); ip.setFont(font); ip.setAntialiasedText(true); ip.setColor(color); ip.drawString(msg, size, size*2); }
private void label(ImageProcessor ip, String msg, Color color) { int size = getHeight()/20; if (size<9) size=9; Font font = new Font("Helvetica", Font.PLAIN, size); ip.setFont(font); ip.setAntialiasedText(true); ip.setColor(color); ip.drawString(msg, size, size*2); }
static void setColor(int red, int green, int blue, boolean foreground) { if (red<0) red=0; if (green<0) green=0; if (blue<0) blue=0; if (red>255) red=255; if (green>255) green=255; if (blue>255) blue=255; Color c = new Color(red, green, blue); if (foreground) { Toolbar.setForegroundColor(c); ImagePlus img = WindowManager.getCurrentImage(); if (img!=null) img.getProcessor().setColor(c); } else Toolbar.setBackgroundColor(c); }
static void setColor(int red, int green, int blue, boolean foreground) { if (red<0) red=0; if (green<0) green=0; if (blue<0) blue=0; if (red>255) red=255; if (green>255) green=255; if (blue>255) blue=255; Color c = new Color(red, green, blue); if (foreground) { Toolbar.setForegroundColor(c); ImagePlus img = WindowManager.getCurrentImage(); if (img!=null) img.getProcessor().setColor(c); } else Toolbar.setBackgroundColor(c); }
/** * @deprecated * replaced by ImageProcessor.draw(Roi) */ public void draw(ImageProcessor ip) { ip.setColor(Toolbar.getForegroundColor()); roi.drawPixels(ip); if (IJ.altKeyDown()) drawLabel(ip); }
public void setColor(Color c) { ImagePlus imp = patch[currentSlice-1].getProject().getLoader().fetchImagePlus(patch[currentSlice-1]); imp.getProcessor().setColor(c); }
public void drawPoint(int i, int c) { int xp = (int)(factor*(x[i]-xmin)) + INDENT; int yp = h + INDENT - (int)(factor*(y[i]-ymin)) ; ip.setColor(c); ip.setFont(FONT); ip.drawLine(xp-3, yp-3, xp+3, yp+3); ip.setLineWidth(2); ip.drawLine(xp-3, yp+3, xp+3, yp-3); if(drawLabels) ip.drawString(labels[i], xp+4, yp+4); }
double getColorValue(Color color) { ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null || imp.getBitDepth()==24) return color.getRGB()&0xffffff; ImageProcessor ip = imp.getProcessor(); ip.setRoi(0,0,1,1); ip = ip.crop(); ip.setColor(color); ip.drawDot(0,0); return ip.getf(0,0); }
public ImageProcessor expandImage(ImageProcessor ipOld, int wNew, int hNew, int xOff, int yOff) { ImageProcessor ipNew = ipOld.createProcessor(wNew, hNew); if (zeroFill) ipNew.setValue(0.0); else ipNew.setColor(Toolbar.getBackgroundColor()); ipNew.fill(); ipNew.insert(ipOld, xOff, yOff); return ipNew; }
public void clear(ImageProcessor ip) { ip.setColor(Toolbar.getBackgroundColor()); if (isLineSelection()) { if (isStraightLine() && roi.getStrokeWidth()>1) ip.fillPolygon(roi.getPolygon()); else roi.drawPixels(); } else if (roi!=null && roi instanceof TextRoi) ((TextRoi)roi).clear(ip); else ip.fill(); // fill with background color ip.setColor(Toolbar.getForegroundColor()); }
public ImageProcessor expandImage(ImageProcessor ipOld, int wNew, int hNew, int xOff, int yOff) { ImageProcessor ipNew = ipOld.createProcessor(wNew, hNew); if (zeroFill) ipNew.setValue(0.0); else ipNew.setColor(Toolbar.getBackgroundColor()); ipNew.fill(); ipNew.insert(ipOld, xOff, yOff); return ipNew; }
ImageProcessor expand(ImageProcessor ip, boolean hasEdgePixels) { if (hasEdgePixels) { ImageProcessor ip2 = ip.createProcessor(ip.getWidth()+2, ip.getHeight()+2); if (foreground==0) { ip2.setColor(255); ip2.fill(); } ip2.insert(ip, 1, 1); //new ImagePlus("ip2", ip2).show(); return ip2; } else return ip; }
double getColorValue(Color color) { ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null || imp.getBitDepth()==24) return color.getRGB()&0xffffff; ImageProcessor ip = imp.getProcessor(); ip.setRoi(0,0,1,1); ip = ip.crop(); ip.setColor(color); ip.drawDot(0,0); return ip.getf(0,0); }