H
husthusthust
Gast
Hallo,
wie kann ich Länge/Breite + Integer-Array mit RGB-Werten ein BufferedImage machen?
Mein Ansatz funktioniert nicht:
wie kann ich Länge/Breite + Integer-Array mit RGB-Werten ein BufferedImage machen?
Mein Ansatz funktioniert nicht:
Java:
if (bf == null) bf = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
int i = 0;
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
bf.setRGB(x, y, image[i]);
i++;
}
}
g.drawImage(bf, 0, 0, this);