-1
隨着BufferedImages
一個Two-Dimensional Array
,有沒有辦法既:從array
創造出奇異的大BufferedImage
或使用個人elements
因此,如何用paintComponent()
實現這個作爲背景使用編譯BufferedImages陣列成單一的BufferedImage
隨着BufferedImages
一個Two-Dimensional Array
,有沒有辦法既:從array
創造出奇異的大BufferedImage
或使用個人elements
因此,如何用paintComponent()
實現這個作爲背景使用編譯BufferedImages陣列成單一的BufferedImage
您發佈的代碼不完整,與您要求的內容很少有關。這說,假設圖像都具有相同的大小,這應該工作:
paintComponent(Graphics g) {
int x = 0;
int y = 0;
int w = worldMap[0][0].getWidth();
int h = worldMap[0][0].getHeight();
for(int r=0; r<WorldMap.length; r++) {
for(int c=0; c<WorldMap[r].length; c++) {
g.drawImage(WorldMap[r][c], x, y, this);
x += w;
}
y += h;
x = 0;
}
}
@ gpasch你是什麼意思 – Lioninn