Graphics object obtained through bufferedImage does not work

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

Graphics object obtained through bufferedImage does not work

Post by pramod » Tue Oct 29, 2002 7:10 pm

BufferedImage image = new BufferedImage(300, 100,BufferedImage.TYPE_INT_ARGB); // Image object to paint with
Graphics2D g = image.createGraphics(); // Get graphics context
(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON); g.setBackground(Color.blue);


Rectangle2D rectangle = new Rectangle2D.Double(0, 0, 300, 100);



CategoryPlot plot = chart.getCategoryPlot();


plot.drawOutlineAndBackground(g,rectangle);

this graphics object does not have any effect

inside a servlet.
and note its not a AWT or swing Component.

i am writing to a fileoutputstream on the server side when i create
to store the JPeg image


how to make this Graphics object take effect
can anybody help
Thanks
Pramod

Dave Gilbert

Re: Graphics object obtained through bufferedImage does not

Post by Dave Gilbert » Wed Oct 30, 2002 9:53 am

It looks like it should work. Any exceptions or other errors?

Regards,

DG.

Locked