<%@ page contentType="image/jpeg" import="java.io.*, java.awt.*, java.awt.image.*,com.sun.image.codec.jpeg.*" %>
<%
try {
int x1 = Integer.parseInt(request.getParameter("x1"));
int y1 = Integer.parseInt(request.getParameter("y1"));
int x2 = Integer.parseInt(request.getParameter("x2"));
int y2 = Integer.parseInt(request.getParameter("y2"));
BufferedImage image = new BufferedImage(480, 400, BufferedImage.TYPE_INT_RGB);
Graphics2D g = image.createGraphics();
g.drawLine(x1, y1, x2, y2);
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(response.getOutputStream());
encoder.encode(image);
} catch (Exception e) {}
%>
|