ID:16399932
大小:20.93 KB
页数:7页
时间:2018-08-09
3、----------------------------如果想自定义图片内容的话,进行以下操作。------------------------------------------------------------Web.xmlWeb.xml中配置生成img的servlet
4、orServlet
5、.Font;importjava.awt.FontMetrics;importjava.awt.Graphics;importjava.awt.Graphics2D;importjava.awt.image.BufferedImage;importjava.io.File;importjava.io.FileInputStream;importjava.io.IOException;importjava.io.InputStream;importjava.util.Date;importjava.util.Pr
6、operties;importjava.util.Random;importjavax.imageio.ImageIO;importjavax.servlet.ServletException;importjavax.servlet.http.HttpServlet;importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletResponse;importcom.linkage.bi.portal.bean.St
7、affSessBean;importcom.linkage.bi.util.DateUtil;importcom.linkage.bi.util.SessionInfoUtil;publicclassFileImageCreatorServletextendsHttpServlet{privateStringfileName;privatestaticRandomrnd=newRandom(newDate().getTime());//图片宽度privateintwidth=400;//图片高度privatei
8、ntheight=200;//外框颜色privateColorrectColor=newColor(255,255,255);//背景色privateColorbgColor=newColor(255,255,255);//干扰线数目privateintlineNum=0;//图片格式privateStringformatName="JPEG";//字体颜色privateColorfo
此文档下载收益归作者所有