public void minimize() { if (IJ.debugMode) IJ.log("minimize: "+unzoomWhenMinimizing); if (unzoomWhenMinimizing) ic.unzoom(); unzoomWhenMinimizing = true; }
public void minimize() { if (IJ.debugMode) IJ.log("minimize: "+unzoomWhenMinimizing); if (unzoomWhenMinimizing) ic.unzoom(); unzoomWhenMinimizing = true; }
/** Implements the Image/Zoom/Original Scale command. * Sets the original range of the x, y axes (unless the plot is frozen) */ public void unzoom() { if (plot == null || plot.isFrozen()) { super.unzoom(); return; } resetMagnification(); plot.setLimitsToDefaults(true); }
/** Implements the Image/Zoom/Original Scale command. * Sets the original range of the x, y axes (unless the plot is frozen) */ public void unzoom() { if (plot == null || plot.isFrozen()) { super.unzoom(); return; } resetMagnification(); plot.setLimitsToDefaults(true); }
private void scaleToFit(ImagePlus imp) { ImageCanvas ic = imp.getCanvas(); if (ic==null) return; if (ic.getScaleToFit()) { ic.setScaleToFit(false); ic.unzoom(); IJ.showStatus("Exiting scale to fit mode (resize with 'alt' key to scale to fit)"); } else { ic.setScaleToFit(true); ic.fitToWindow(); IJ.showStatus("Resize window to scale (use 'alt' key as shortcut)"); } }
private void scaleToFit(ImagePlus imp) { ImageCanvas ic = imp.getCanvas(); if (ic==null) return; if (ic.getScaleToFit()) { ic.setScaleToFit(false); ic.unzoom(); IJ.showStatus("Exiting scale to fit mode (resize with 'alt' key to scale to fit)"); } else { ic.setScaleToFit(true); ic.fitToWindow(); IJ.showStatus("Resize window to scale (use 'alt' key as shortcut)"); } }
if (ic.getMagnification()<1.0) imp.repaintWindow(); } else if (arg.equals("orig")) ic.unzoom(); else if (arg.equals("100%")) ic.zoom100Percent();
if (ic.getMagnification()<1.0) imp.repaintWindow(); } else if (arg.equals("orig")) ic.unzoom(); else if (arg.equals("100%")) ic.zoom100Percent();
/** Implements the Image/Zoom/View 100% command. */ public void zoom100Percent() { if (magnification==1.0) return; double imag = imp.getWindow().getInitialMagnification(); if (magnification!=imag) unzoom(); if (magnification==1.0) return; if (magnification<1.0) { while (magnification<1.0) zoomIn(imageWidth/2, imageHeight/2); } else if (magnification>1.0) { while (magnification>1.0) zoomOut(imageWidth/2, imageHeight/2); } else return; int x=xMouse, y=yMouse; if (mouseExited) { x = imageWidth/2; y = imageHeight/2; } int sx = screenX(x); int sy = screenY(y); adjustSourceRect(1.0, sx, sy); repaint(); }
/** Implements the Image/Zoom/View 100% command. */ public void zoom100Percent() { if (magnification==1.0) return; double imag = imp.getWindow().getInitialMagnification(); if (magnification!=imag) unzoom(); if (magnification==1.0) return; if (magnification<1.0) { while (magnification<1.0) zoomIn(imageWidth/2, imageHeight/2); } else if (magnification>1.0) { while (magnification>1.0) zoomOut(imageWidth/2, imageHeight/2); } else return; int x=xMouse, y=yMouse; if (mouseExited) { x = imageWidth/2; y = imageHeight/2; } int sx = screenX(x); int sy = screenY(y); adjustSourceRect(1.0, sx, sy); repaint(); }
if (imp!=null) { ImageCanvas ic = imp.getCanvas(); if (ic!=null) ic.unzoom();
if (imp!=null) { ImageCanvas ic = imp.getCanvas(); if (ic!=null) ic.unzoom();
void zoomToSelection(ImagePlus imp, ImageCanvas ic) { Roi roi = imp.getRoi(); ic.unzoom(); if (roi==null) return; Rectangle w = imp.getWindow().getBounds(); Rectangle r = roi.getBounds(); double mag = ic.getMagnification(); int marginw = (int)((w.width - mag * imp.getWidth())); int marginh = (int)((w.height - mag * imp.getHeight())); int x = r.x+r.width/2; int y = r.y+r.height/2; mag = ic.getHigherZoomLevel(mag); while(r.width*mag<w.width - marginw && r.height*mag<w.height - marginh) { ic.zoomIn(ic.screenX(x), ic.screenY(y)); double cmag = ic.getMagnification(); if (cmag==32.0) break; mag = ic.getHigherZoomLevel(cmag); w = imp.getWindow().getBounds(); } }
void zoomToSelection(ImagePlus imp, ImageCanvas ic) { Roi roi = imp.getRoi(); ic.unzoom(); if (roi==null) return; Rectangle w = imp.getWindow().getBounds(); Rectangle r = roi.getBounds(); double mag = ic.getMagnification(); int marginw = (int)((w.width - mag * imp.getWidth())); int marginh = (int)((w.height - mag * imp.getHeight())); int x = r.x+r.width/2; int y = r.y+r.height/2; mag = ic.getHigherZoomLevel(mag); while(r.width*mag<w.width - marginw && r.height*mag<w.height - marginh) { ic.zoomIn(ic.screenX(x), ic.screenY(y)); double cmag = ic.getMagnification(); if (cmag==32.0) break; mag = ic.getHigherZoomLevel(cmag); w = imp.getWindow().getBounds(); } }