ij.ImageJ.createImage()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(202)

本文整理了Java中ij.ImageJ.createImage()方法的一些代码示例,展示了ImageJ.createImage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageJ.createImage()方法的具体详情如下:
包路径:ij.ImageJ
类名称:ImageJ
方法名:createImage

ImageJ.createImage介绍

暂无

代码示例

代码示例来源:origin: net.imagej/ij

void setIcon() throws Exception {
  URL url = this.getClass().getResource("/microscope.gif");
  if (url==null) return;
  Image img = createImage((ImageProducer)url.getContent());
  if (img!=null) setIconImage(img);
}

代码示例来源:origin: imagej/ImageJA

void setIcon() throws Exception {
  URL url = this.getClass().getResource("/microscope.gif");
  if (url==null) return;
  Image img = createImage((ImageProducer)url.getContent());
  if (img!=null) setIconImage(img);
}

代码示例来源:origin: sc.fiji/TrakEM2_

synchronized private JFrame newJFrame(final String title) {
    final JFrame frame = new JFrame(title);

    if (null == icon) {
      try {
        Field mic = ImageJ.class.getDeclaredField("iconPath");
        mic.setAccessible(true);
        String path = (String) mic.get(IJ.getInstance());
        icon = IJ.getInstance().createImage((ImageProducer) new URL("file:" + path).getContent());
      } catch (Exception e) {}
    }

    if (null != icon) frame.setIconImage(icon);
    return frame;
  }
}

代码示例来源:origin: sc.fiji/Fiji_Plugins

public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException {
    if (!isDataFlavorSupported(flavor))
      throw new UnsupportedFlavorException(flavor);
    int w = ip.getWidth();
    int h = ip.getHeight();
    Image img = IJ.getInstance().createImage(w, h);
    Graphics g = img.getGraphics();
    g.drawImage(ip.createImage(), 0, 0, null);
    g.dispose();
    return img;
  }
}, null);

代码示例来源:origin: sc.fiji/fiji-compat

public static void run(String title, String iconPath) {
    try {
      ImageJ ij = IJ.getInstance();
      if (ij == null)
        return;
      if (title != null)
        ij.setTitle(title);
      URL url = new URL(iconPath);
      ImageProducer ip = (ImageProducer)url.getContent();
      Image img = ij.createImage(ip);
      if (img!=null)
        ij.setIconImage(img);
    } catch (Exception e) {
      IJ.error("Could not set the icon: '" + iconPath + "'");
      e.printStackTrace();
    }
  }
}

代码示例来源:origin: net.imagej/ij

Image img = IJ.getInstance().createImage(imageWidth, imageHeight);
Graphics g = img.getGraphics();
g.setColor(Color.white);

代码示例来源:origin: imagej/ImageJA

Image img = IJ.getInstance().createImage(imageWidth, imageHeight);
Graphics g = img.getGraphics();
g.setColor(Color.white);

代码示例来源:origin: net.imagej/imagej-legacy

if (iconURL != null) try {
  final Object producer = iconURL.getContent();
  final Image image = ij1.createImage((ImageProducer) producer);
  ij1.setIconImage(image);
  if (IJ.isMacOSX()) try {

代码示例来源:origin: net.imagej/ij

public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException {
  if (!isDataFlavorSupported(flavor))
    throw new UnsupportedFlavorException(flavor);
  ImagePlus imp = WindowManager.getCurrentImage();
  if (imp!=null) {
    imp = flatten(imp);
    ImageProcessor ip;
    if (imp.isComposite()) {
      ip = new ColorProcessor(imp.getImage());
      ip.setRoi(imp.getRoi());
    } else	
      ip = imp.getProcessor();
    ip = ip.crop();
    int w = ip.getWidth();
    int h = ip.getHeight();
    IJ.showStatus(w+"x"+h+ " image copied to system clipboard");
    Image img = IJ.getInstance().createImage(w, h);
    Graphics g = img.getGraphics();
    g.drawImage(ip.createImage(), 0, 0, null);
    g.dispose();
    return img;
  } else {
    //IJ.noImage();
    return null;
  }
}

代码示例来源:origin: imagej/ImageJA

public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException {
  if (!isDataFlavorSupported(flavor))
    throw new UnsupportedFlavorException(flavor);
  ImagePlus imp = WindowManager.getCurrentImage();
  if (imp!=null) {
    imp = flatten(imp);
    ImageProcessor ip;
    if (imp.isComposite()) {
      ip = new ColorProcessor(imp.getImage());
      ip.setRoi(imp.getRoi());
    } else	
      ip = imp.getProcessor();
    ip = ip.crop();
    int w = ip.getWidth();
    int h = ip.getHeight();
    IJ.showStatus(w+"x"+h+ " image copied to system clipboard");
    Image img = IJ.getInstance().createImage(w, h);
    Graphics g = img.getGraphics();
    g.drawImage(ip.createImage(), 0, 0, null);
    g.dispose();
    return img;
  } else {
    //IJ.noImage();
    return null;
  }
}

代码示例来源:origin: imagej/ImageJA

if (url!=null) {
  Image img = null;
  try {img = ij.createImage((ImageProducer)url.getContent());}
  catch(Exception e) {}
  if (img!=null) {

代码示例来源:origin: net.imagej/ij

if (url!=null) {
  Image img = null;
  try {img = ij.createImage((ImageProducer)url.getContent());}
  catch(Exception e) {}
  if (img!=null) {

相关文章