This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
First off, and probably unrelated to the rpoblem you seek help with, a painting method override is no place to be performing disk I/O or constructing BufferedImages or most any other object, with the possible exception of geopmetry primitives (and that too is best avoided). Any painting method must be lean and return fast.
If you need frequent or periodic updates, use a Swing Timer and cal repaint() when done. Your painting method override will then have just one line to paint the already loaded image (and a call to the super implementation if the entire component area isn't covered by the image -- not the case here).
I don't see anywhere that you fill the background of your new BufferedImage, nor where you set the color of its Graphics reference, so I would fully expect
that the background goes black as the strokes go white.
There are no new questions, but there may be new answers.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Saving a drawed image to a file reverses its colors