Using Large BackgroundImages

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
John Duggins

Using Large BackgroundImages

Post by John Duggins » Fri May 17, 2002 3:42 pm

Greetings All,

For the last few days, I've been attempting to create a chart using a large Image (5750 x 9000 pixels). When I do pass that Image into setBackgroundImage(), it gets saved in correctly, but doesn't get written to the final chart.

I believe that I've traced the problem to the JFreeChart.createBufferedImage(int,int) method where the g2.destroy() is run before the assync drawImage() from JFreeChart.draw() is finished writing the image out to the device.

I haven't found a solution that will work yet. Anyone else encountered this problem?

Andrew Perepelytsya

Re: Using Large BackgroundImages

Post by Andrew Perepelytsya » Fri May 17, 2002 7:44 pm

Got some ideas (maybe even correct ones ;) I haven't gone exploring this part of the code, though.

What if we put the call to JFreeChart.draw() on a separate thread and join() the thread with the destroy() call thread, so the destroy waits for the draw() to finish before proceding.

If I misunderstood the question, pleeze don't flame me :)

Sun have nice multithreading tutorials on on their site.

Locked