package com.bjsxt.controller;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.sql.rowset.serial.SerialException;
import java.awt.image.BufferedImage;
import java.io.IOException;
@WebServlet("/codeServlet")
class CodeServlet extends HttpServlet{
@override
protected void service(HttpServletRequest req,HttpServletResponse resp)throws SerialException, IOException {
//在内存中创建图像
int width = 110,height = 30;
BufferedImage image = new BufferedImage(width,herght,BufferedImage,TYPE_INT_RGB);
//获取图像上下文
Graphics g = image.getGraphics();
//设置背景色
g.setColor(getRandColor(fc:200,bc:250));
}
}
OA系统06-获取上下文设置背景色
最新推荐文章于 2022-12-09 20:49:15 发布