Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds!
at sun.awt.image.IntegerInterleavedRaster.setDataElements(IntegerInterleavedRaster.java:301)
at java.awt.image.BufferedImage.setRGB(BufferedImage.java:988)
at MyManager.imageMan.fazerNova(imageMan.java:354)
at MyManager.imageMan.main(imageMan.java:472)
我需要一些帮助。
public static BufferedImage fazerNova(int abc[],BufferedImage img) {
BufferedImage teste1 = new BufferedImage(img.getWidth(), img.getHeight(), BufferedImage.TYPE_INT_RGB);
for (int k = 0; k < abc.length; k++) {
int w1 = abc[k] % img.getWidth();
int h1 = (int) Math.floor(abc[k] / img.getWidth());
teste1.setRGB(w1, h1, 0xffffff);
}
return teste1;
}