setRGB() in java

前端 未结 2 1450
孤城傲影
孤城傲影 2020-12-16 19:25

I am using setRGB() for changing the values of the pixel of an image.

int rgb=new Color(0,0,0).getRGB();
image1.setRGB(i,j,rgb); //where i,j is the boundarie         


        
2条回答
  •  孤街浪徒
    2020-12-16 19:43

     Color col = new Color(newValue, newValue, newValue);
                image1.setRGB(i, j, col.getRGB());
    

提交回复
热议问题