<%@ page contentType="text/html;charset=utf-8"%>
<%@ page import="java.awt.Graphics"%>
<%@ page import="java.awt.Color"%>
<%@ page import="java.awt.Font"%>
<%@ page import="java.awt.image.BufferedImage"%>
<%@ page import="java.io.BufferedInputStream"%>
<%@ page import="java.io.File"%>
<%@ page import="javax.imageio.ImageIO"%>
<%@ page import="java.io.InputStream"%>
<%@ page import="java.awt.Graphics2D"%>
<%@ page import="java.awt.Image"%>
<%@ page import="java.net.URL"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.OutputStream"%>
<%@ page import="java.util.Hashtable"%>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="java.util.Calendar"%>
<%@ include file="database.jsp"%>
<%
request.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");
out.clear();
out = pageContext.pushBody();
OutputStream os = response.getOutputStream();
int width = 400, height = 300;
Font font = new Font("Monospaced", Font.PLAIN, 11);
try {
BufferedImage buffer_image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics g = buffer_image.getGraphics();
g.setFont(font);
g.setColor(new Color(255, 255, 255));
g.fillRect(0, 0, width, height);
g.setFont(new Font("Monospaced", Font.PLAIN, 35));
g.setColor(new Color(0, 0, 255));
g.drawString("K7", width/2, height/2);
ImageIO.write(buffer_image, "png", os);
//ImageIO.write(buffer_image, "png", new File("C:\\image_test.png"));
os.close();
} catch (Exception e) {
out.println(e.getMessage());
} finally {
}
%>
'Carpe Programming > jsp & spring & jstl' 카테고리의 다른 글
JSTL Session 값 얻기 (0) | 2015.05.16 |
---|---|
[tiles] 설정하기 (0) | 2014.03.10 |
[jQuery] 외부 로드로 웹 트레픽 줄이기 (0) | 2013.07.12 |
[spring] 스케쥴러 설정 (0) | 2013.02.18 |
[jdbc] spring + jeus 환경에서 jeus connection pool 사용 (0) | 2013.01.24 |