我有:
BufferedImage image;
//few lines of code
public void stateChanged(ChangeEvent e)
{
for (int i = 0; i < image.getWidth(); i++) {
for (int j = 0; j < image.getHeight(); j++)
{
Color color = new Color(image.getRGB(i, j));
int r, g, b;
val = sliderBrightness.getValue();
r = color.getRed() + val;
g = color.getGreen() + val;
b = color.getBlue() + val;
}
}
我不知道如何解决这个问题,我应该如何修改 Image 将对 JSlider 亮度做出反应?