Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
for(int x=0;x<20;x++) { for(int y=0;y<20;y++) { img.setRGB(x, y,0); } }
20*20 領域のすべてのピクセルを黒色に変換しようとしています。しかし、これは上記のコードでは機能しません。さらに何か追加する必要がありますか?
これを試して
int rgb=new Color(0,0,0).getRGB(); // i believe rgb for black is 0,0,0 but cross check for(int x=0;x<20;x++){ for(int y=0;y<20;y++){ img.setRGB(x, y,rgb); } }