I’m currently making a program doing very simple 2D graphics. I used to in the past, for pixel by pixel animation, use an array of integers and a MemoryImageSource. The problem with this is the fact that you can’t grab the Graphics object of this image, and then use it to draw images, or fill circles normally. BufferedImages supposively allow you to do this now, but every attempt I’ve made at using it’s ability to draw pixels directly has resulted in EXTREMELY low frame rates.
Also, another problem is the fact that the Color object NEEDS to be used when drawing a Oval, or a Rectangle. If I’m creating 30 Color Objects a second, the garbage collector goes nuts and my frame-rates drop too. The only solution I’ve found is to make all of the Colors, and store them before drawing to the screen. What I would like to do is to change the Color using an Integer value, and draw using the same Color object, rather than creating a new one every time.
-Jason Thomas.