java.awt.image.BufferedImage.getMinY()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(228)

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

BufferedImage.getMinY介绍

暂无

代码示例

代码示例来源:origin: 0opslab/opslabJutil

/**
 * 改变成二进制码
 *
 * @param file
 * @return
 */
public static String[][] getPX(File file) {
  int[] rgb = new int[3];
  BufferedImage bi = null;
  try {
    bi = ImageIO.read(file);
  } catch (Exception e) {
    e.printStackTrace();
  }
  int width = bi.getWidth();
  int height = bi.getHeight();
  int minx = bi.getMinX();
  int miny = bi.getMinY();
  String[][] list = new String[width][height];
  for (int i = minx; i < width; i++) {
    for (int j = miny; j < height; j++) {
      int pixel = bi.getRGB(i, j);
      rgb[0] = (pixel & 0xff0000) >> 16;
      rgb[1] = (pixel & 0xff00) >> 8;
      rgb[2] = (pixel & 0xff);
      list[i][j] = rgb[0] + "," + rgb[1] + "," + rgb[2];
    }
  }
  return list;
}

代码示例来源:origin: geotools/geotools

private Map<Integer, Integer> getColorFreq(BufferedImage image) {
  Map<Integer, Integer> colorFreq = new HashMap<Integer, Integer>();
  for (int y = image.getMinY(), ny = 0; ny < image.getHeight(); y++, ny++) {
    for (int x = image.getMinX(), nx = 0; nx < image.getWidth(); x++, nx++) {
      int rgb = image.getRGB(x, y);
      Integer freq = colorFreq.get(rgb);
      if (freq == null) {
        colorFreq.put(rgb, 1);
      } else {
        freq++;
      }
    }
  }
  return colorFreq;
}

代码示例来源:origin: org.bidib.jbidib.eu.hansolo/SteelSeries

@Override
public Rectangle2D getBounds2D() {
  return new Rectangle2D.Double(bImage.getMinX(), bImage.getMinY(), bImage.getWidth(), bImage.getHeight());
}

代码示例来源:origin: org.bidib.jbidib.eu.hansolo/SteelSeries

@Override
public Rectangle2D getBounds2D() {
  return new Rectangle2D.Double(bImage.getMinX(), bImage.getMinY(), bImage.getWidth(), bImage.getHeight());
}

代码示例来源:origin: org.bidib.jbidib.eu.hansolo/SteelSeries

@Override
public Rectangle2D getBounds2D() {
  return new Rectangle2D.Double(bImage.getMinX(), bImage.getMinY(), bImage.getWidth(), bImage.getHeight());
}

代码示例来源:origin: org.bidib.jbidib.eu.hansolo/SteelSeries

@Override
public Rectangle2D getBounds2D() {
  return new Rectangle2D.Double(bImage.getMinX(), bImage.getMinY(), bImage.getWidth(), bImage.getHeight());
}

代码示例来源:origin: org.bidib.jbidib.eu.hansolo/SteelSeries

@Override
public Rectangle2D getBounds2D() {
  return new Rectangle2D.Double(bImage.getMinX(), bImage.getMinY(), bImage.getWidth(), bImage.getHeight());
}

代码示例来源:origin: HanSolo/SteelSeries-Swing

@Override
public Rectangle2D getBounds2D() {
  return new Rectangle2D.Double(bImage.getMinX(), bImage.getMinY(), bImage.getWidth(), bImage.getHeight());
}

代码示例来源:origin: HanSolo/SteelSeries-Swing

@Override
public Rectangle2D getBounds2D() {
  return new Rectangle2D.Double(bImage.getMinX(), bImage.getMinY(), bImage.getWidth(), bImage.getHeight());
}

代码示例来源:origin: org.bidib.jbidib.eu.hansolo/SteelSeries

@Override
public Rectangle2D getBounds2D() {
  return new Rectangle2D.Double(bImage.getMinX(), bImage.getMinY(), bImage.getWidth(), bImage.getHeight());
}

代码示例来源:origin: org.apache.xmlgraphics/batik-awt-util

/**
 * Construct an instance of CachableRed around a BufferedImage.
 */
public BufferedImageCachableRed(BufferedImage bi) {
  super((CachableRed)null,
     new Rectangle(bi.getMinX(),  bi.getMinY(),
            bi.getWidth(), bi.getHeight()),
     bi.getColorModel(), bi.getSampleModel(),
     bi.getMinX(), bi.getMinY(), null);
  this.bi = bi;
}

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

/**
 * Construct an instance of CachableRed around a BufferedImage.
 */
public BufferedImageCachableRed(BufferedImage bi) {
  super((CachableRed)null,
     new Rectangle(bi.getMinX(),  bi.getMinY(),
            bi.getWidth(), bi.getHeight()),
     bi.getColorModel(), bi.getSampleModel(),
     bi.getMinX(), bi.getMinY(), null);
  this.bi = bi;
}

代码示例来源:origin: org.apache.xmlgraphics/xmlgraphics-commons

/**
 * Construct an instance of CachableRed around a BufferedImage.
 */
public BufferedImageCachableRed(BufferedImage bi) {
  super((CachableRed)null,
     new Rectangle(bi.getMinX(),  bi.getMinY(),
            bi.getWidth(), bi.getHeight()),
     bi.getColorModel(), bi.getSampleModel(),
     bi.getMinX(), bi.getMinY(), null);
  this.bi = bi;
}

代码示例来源:origin: featurecat/lizzie

private void drawContainer(Graphics g, int vx, int vy, int vw, int vh) {
 if (vw <= 0
   || vh <= 0
   || vx < cachedBackground.getMinX()
   || vx + vw > cachedBackground.getMinX() + cachedBackground.getWidth()
   || vy < cachedBackground.getMinY()
   || vy + vh > cachedBackground.getMinY() + cachedBackground.getHeight()) {
  return;
 }
 BufferedImage result = new BufferedImage(vw, vh, TYPE_INT_ARGB);
 filter20.filter(cachedBackground.getSubimage(vx, vy, vw, vh), result);
 g.drawImage(result, vx, vy, null);
}

代码示例来源:origin: apache/batik

/**
 * Construct an instance of CachableRed around a BufferedImage.
 */
public BufferedImageCachableRed(BufferedImage bi) {
  super((CachableRed)null,
     new Rectangle(bi.getMinX(),  bi.getMinY(),
            bi.getWidth(), bi.getHeight()),
     bi.getColorModel(), bi.getSampleModel(),
     bi.getMinX(), bi.getMinY(), null);
  this.bi = bi;
}

代码示例来源:origin: eseifert/vectorgraphics2d

@Override
public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs) {
  BufferedImage bimg = getTransformedImage(img, xform);
  return drawImage(bimg, bimg.getMinX(), bimg.getMinY(),
    bimg.getWidth(), bimg.getHeight(), null, null);
}

代码示例来源:origin: cytoscape/application

protected void renderImage(Graphics graphics) {
  super.renderImage(graphics);
  
  final Graphics2D g2d = (Graphics2D) graphics;
  // Render
  update();
  g2d.setPaint(paintFactory.getPaint(bound.getBounds2D()));
  g2d.fillOval(rendered.getMinX(), rendered.getMinY(), 
      width, height);
}

代码示例来源:origin: cytoscape/application

protected void renderImage(Graphics graphics) {
  super.renderImage(graphics);
  
  final Graphics2D g2d = (Graphics2D) graphics;
  // Render
  update();
  g2d.setPaint(paintFactory.getPaint(bound.getBounds2D()));
  g2d.fillRoundRect(rendered.getMinX(), rendered.getMinY(), 
      rendered.getWidth(), rendered.getHeight(), r, r);
}

代码示例来源:origin: com.github.sviperll/chicory-common

@Override
public Rectangle2D getBounds2D(BufferedImage src) {
  if (opHor != null && opVer != null) {
    return opHor.getBounds2D(src).createIntersection(opVer.getBounds2D(src));
  } else if (opVer != null) {
    return opVer.getBounds2D(src);
  } else if (opHor != null) {
    return opHor.getBounds2D(src);
  } else
    return new Rectangle2D.Float(src.getMinX(), src.getMinY(), src.getWidth(), src.getHeight());
}

代码示例来源:origin: com.github.sviperll/chicory-core

@Override
public Rectangle2D getBounds2D(BufferedImage src) {
  if (opHor != null && opVer != null) {
    return opHor.getBounds2D(src).createIntersection(opVer.getBounds2D(src));
  } else if (opVer != null) {
    return opVer.getBounds2D(src);
  } else if (opHor != null) {
    return opHor.getBounds2D(src);
  } else
    return new Rectangle2D.Float(src.getMinX(), src.getMinY(), src.getWidth(), src.getHeight());
}

相关文章