数字怎么生成jpg格式的图片,比如数字123,生成一个图片是有数字123的
BufferedImage b = new BufferedImage(140, 50, BufferedImage.TYPE_INT_RGB);
Graphics g = b.getGraphics();
g.setColor(Color.WHITE);
g.setFont(new Font("宋体", Font.BOLD, 60));
g.drawString("2333", 10, 50);
try {
ImageIO.write(b, "jpg", new File("D:/test.jpg"));
} catch (IOException e) {
e.printStackTrace();
}
这里正好有一篇http://blog.csdn.net/wohuozheng/article/details/53688362
这段代码直接就能生成图片吗
做验证码???网上搜索一大堆