Is this incorrect? I change the height and width or I will get Index Out of Bound Exception. for(int y=0;y<height;y++){ for(int x=0;x<width;x++){ int r = scanner.nextInt(); int g = scanner.nextInt(); int b = scanner.nextInt(); Color color = Color.rgb(r, g, b); pixelWriter.setColor(x, y, color); } }
3 件のコメント:
Is this incorrect?
I change the height and width or I will get Index Out of Bound Exception.
for(int y=0;y<height;y++){
for(int x=0;x<width;x++){
int r = scanner.nextInt();
int g = scanner.nextInt();
int b = scanner.nextInt();
Color color = Color.rgb(r, g, b);
pixelWriter.setColor(x, y, color);
}
}
もう遅いと思うけど、もう少し情報がほしいなあ。。
x is for width, not for height(in your code), I think. y vice versa.
コメントを投稿