ID:50937067
大小:50.22 KB
页数:7页
时间:2020-03-16
3、--如果想自定义图片内容的话,进行以下操作。------------------------------------------------------------Web.xmlWeb.xml中配置生成img的servlet 4、vlet-mapping> 5、hics;importjava.awt.Graphics2D;importjava.awt.image.BufferedImage;importjava.io.File;importjava.io.FileInputStream;importjava.io.IOException;importjava.io.InputStream;importjava.util.Date;importjava.util.Properties;importjava.util.Random;importjavax.imageio.ImageIO;impor 6、tjavax.servlet.ServletException;importjavax.servlet.http.HttpServlet;importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletResponse;importcom.linkage.bi.portal.bean.StaffSessBean;importcom.linkage.bi.util.DateUtil;importcom.linkage.bi.util.Sessi 7、onInfoUtil;publicclassFileImageCreatorServletextendsHttpServlet{privateStringfileName;privatestaticRandomrnd=newRandom(newDate().getTime());//图片宽度privateintwidth=400;//图片高度privateintheight=200;//外框颜色privateColorrectColor=newColor(255,255,255);//背景色privateColorbgColor=new 8、Color(255,255,255);//干扰线数目privateintlineNum=0;//图片格式privateStringformatName="JPEG";//字体颜色privateColorfo
此文档下载收益归作者所有