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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -