How to display image after using setRGB(x,y,0) in Java? -
for(int x=0;x<20;x++) { for(int y=0;y<20;y++) { img.setrgb(x, y,0); } }
i'm trying convert pixels in 20*20 region black colour. not working above code. need add more?
try this
int rgb=new color(0,0,0).getrgb(); // believe rgb black 0,0,0 cross check for(int x=0;x<20;x++){ for(int y=0;y<20;y++){ img.setrgb(x, y,rgb); } }
Comments
Post a Comment