标签:https 乱码 post 改变 特殊字符 refresh dispatch phi 格式
OutputStream out = response.getOutputStream();
PrintWriter pw = response.getWriter();
setContentType(“text/html”) // 内容是html
setCharacterEncoding("gb2312");
BufferedImage image = new BufferedImage(width, height,BufferedImage.TYPE_INT_RGB);
Graphics graphics = image.getGraphics();
graphics.setColor(Color.WHITE);
graphics.fillRect(0, 0, width, height);
graphics.setColor(Color.BLUE);
graphics.drawRect(0, 0, width - 1, height - 1);
Random random = new Random();
random.nextInt(n); // 生成0 到 n的随机数 前闭后开
graphics.drawLine(x1, y1, x2, y2);
graphics.setFont(new Font("Times New Roman", Font.PLAIN, 18));
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890";
汉字:\u4e00 —— \u9fa5
graphics.drawString(str, x, y);
Graphics2D graphics = (Graphics2D) image.getGraphics();
graphics.rotate(theta, x, y);
graphics.dispose();
ImageIO.write(image, "jpg", resp.getOutputStream());
标签:https 乱码 post 改变 特殊字符 refresh dispatch phi 格式
原文地址:http://www.cnblogs.com/lrong/p/6876427.html