• Post Reply Bookmark Topic Watch Topic
  • New Topic

Images query  RSS feed

colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...


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...


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.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!