This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
How to generate JPEG Images?
Posted by Sudhakar on October 16, 2000 at 12:45 PM
I want to generate a PIE-chart using data available in the database (in PJEG format). Could anyone guide me on the same? I have been able to create JPEG images but do not know if there are some utilities or some way of generating them. The following is the code I used for JPEG generation but it seems to be a real crude method if i am looking at generating pie-charts.
public class Picture
static Graphics pie;
// static BufferedImage Bi;
// static Graphics2D Gra;
public static void main(String args)
BufferedImage Bi=new BufferedImage(100,100,1);
Color col=new Color(210,210,210);
// Picture pic =new Picture();
ImgEnc = JPEGCodec.createJPEGEncoder(new FileOutputStream("Abc1.jpg"));
Let me know if there is an alternative for the same. Thank you,