Hi, I'm rebuilding my rubiks cube program.
This is basically 27 small images(to build cube), with a large image(500,500) for the background of the JPanel.
While I was rebuilding the cube, I used a large red rectangle for the background, before I put the real background in...
bufferGraphics_.setColor(Color.red);
bufferGraphics_.fillRect(0,0,500,500);
After running program, and making the cube rotate, small flashes started appearing between the small images on the cube.
But when I replaced the code above with...
bufferGraphics_.drawImage(background_,0,0,this);
The flashing stopped, so I'm thinking it was giving it more work to do by filling in the red rectangle than by drawing the large background.
Which is probably the reason for the flashes, since the repaints are quite frequent.
Another question, is it better to use BufferedImages, or just Images, when I apply drawImage ?
Which gives better results?
Also does the image type (used in constructor of BufferedImage) make any difference when applying drawImage?
Thanks for any help.
This is basically 27 small images(to build cube), with a large image(500,500) for the background of the JPanel.
While I was rebuilding the cube, I used a large red rectangle for the background, before I put the real background in...
bufferGraphics_.setColor(Color.red);
bufferGraphics_.fillRect(0,0,500,500);
After running program, and making the cube rotate, small flashes started appearing between the small images on the cube.
But when I replaced the code above with...
bufferGraphics_.drawImage(background_,0,0,this);
The flashing stopped, so I'm thinking it was giving it more work to do by filling in the red rectangle than by drawing the large background.
Which is probably the reason for the flashes, since the repaints are quite frequent.
Another question, is it better to use BufferedImages, or just Images, when I apply drawImage ?
Which gives better results?
Also does the image type (used in constructor of BufferedImage) make any difference when applying drawImage?
Thanks for any help.