Download: Click to download the presentation: This site does not support JSP space imaging_toweb.jsp <% @ Page Autoflush = "false" import = "java.aw. *, Java.awt.codec. JPEG. *, java.util. * "%> <% string imageStr = request.getParameter (" id_text "); if (imageStr == null || imageStr.Equals (")) {response.setContentType ("text / HTML; Charset = GB2312 ");%>
http://www.lionsky.net title> Form> body> html> <%} else {out.clear (); response.setContentType (" image / jpeg "); response.addheader (" Pragma "," no-cache ") ; response.addHeader ( "Cache-Control", "no-cache"); response.addDateHeader ( "Expries", 0); int width = 300, height = 100; BufferedImage image = new BufferedImage (width, height, BufferedImage. TYPE_INT_RGB); Graphics g = image.getgraphics (); // The following fill the background color g.SetColor (color.lightgray); g.FillRect (0, 0, width, height); string random = "random"; // The following setup G.SetColor (color.black); g.drawstring ("http://www.lionsky.net", 10, 20); g.drawstring ("Author: lion [lion-a@sohu.com]", 10, 40); g.drawline (10 , 50, 290, 50); g.drawstring (imageStr, 10, 70); g.dispose ();