i dont know if its the best way to do..but i have done it the following way

Called BarGraph.jsp in a html in thus

<img src="BarGraph.jsp?choose=<%=strTable%>">

BARGRAGH.JSP
<%@ page language='java' %>
<%@ page import="java.sql.*,cv_classification.*
,java.awt.*,java.awt.image.BufferedImage,com.sun.image.codec.jpeg.*,java.app
let.*,java.util.*" %>



<%



//The graph is going to be an image in JPEG format, so we'll need to set the
correct MIME, or content type.
//The browser uses the MIME type to decide how to display the response.
//The following code sets the MIME type:
response.setContentType("image/jpeg");

//The Java 2D API supplies the BufferedImage class,
//which provides a way to store and manage pixel data in memory.
BufferedImage bi = new
BufferedImage(NLP_Constants.WIDTH,NLP_Constants.HEIGHT,
BufferedImage.TYPE_INT_RGB);

Graphics2D g = (Graphics2D)bi.getGraphics();

g.setPaint(Color.white);


// set up the Graphics2D context by calling the createGraphics() method:

ServletOutputStream out0 = response.getOutputStream();

JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out0);
encoder.encode(bi);


%>












----- Original Message -----
From: "Cesar Garcia Hernandez" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 15, 2004 4:47 AM
Subject: Generating Images on the fly


> hello everyone, im new on the list.
>
> I was looking for a good examples of how to generate images on the fly
> with jsp. I search in google but i cant find one really good.
>
> Do you know where can i find a really good example about it?
>
> thanks to everyone.
>
> regards
>
> --
> Cesar Garcia Hernandez
> -----------------------------------
> Desarrollador de Soluciones Web y Windows
> Telf: 950-00020
> Email : [EMAIL PROTECTED]
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
>
> Some relevant archives, FAQs and Forums on JSPs can be found at:
>
>  http://java.sun.com/products/jsp
>  http://archives.java.sun.com/jsp-interest.html
>  http://forums.java.sun.com
>  http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com

Reply via email to