I'm having trouble trying to get a colour other than blue with a BufferedImage
So I've got my buffered image, and just for testing I've got a loop to colour in the top left corner, however no matter what RGB value i set, it only colours in blue. Changing the value changes how bright the blue is.
static BufferedImage I = new BufferedImage(X, Y, BufferedImage.TYPE_INT_RGB);
...
for (int i = 0; i<100; i++)
{
for (int j = 0; j < 100; j++)
{
I.setRGB(i,j,100);
}
}
Frame f = new Frame("Mandelbrot");
f.add("Center", new MandelCanvas());
f.setSize(X,Y);
f.setVisible(true);
...
class MandelCanvas extends Canvas
{
public void paint(Graphics g)
{
g.drawImage(Mandelbrot.I, 0, 0, null);
}
}
Question
Moustacha
I'm having trouble trying to get a colour other than blue with a BufferedImage
So I've got my buffered image, and just for testing I've got a loop to colour in the top left corner, however no matter what RGB value i set, it only colours in blue. Changing the value changes how bright the blue is.
static BufferedImage I = new BufferedImage(X, Y, BufferedImage.TYPE_INT_RGB); ... for (int i = 0; i<100; i++) { for (int j = 0; j < 100; j++) { I.setRGB(i,j,100); } } Frame f = new Frame("Mandelbrot"); f.add("Center", new MandelCanvas()); f.setSize(X,Y); f.setVisible(true); ... class MandelCanvas extends Canvas { public void paint(Graphics g) { g.drawImage(Mandelbrot.I, 0, 0, null); } }Is there some special voodoo magic I'm missing?
Link to comment
Share on other sites
1 answer to this question
Recommended Posts