int width=88;
int height=22;
BufferedImage img = new BufferedImage(width, height,BufferedImage.TYPE_INT_RGB);
Graphics g = img.getGraphics();
Graphics2D g2d = (Graphics2D) g;
g2d.setFont(new Font("黑体",Font.BOLD,17));
Random r = new Random();
for(int i=0;i4;i++){
String str = ""+r.nextInt(10);
AffineTransform aff = new AffineTransform();
aff.rotate(Math.random(),i*18,height-5);
aff.scale(0.6+Math.random(), 0.6+Math.random());
g2d.setTransform(aff);
g2d.drawString(str,i*18,height-5);
System.err.println(":"+str);
}
g2d.dispose();
ImageIO.write(img, "JPEG",resp.getOutputStream());
}
关于java代码产生随机汉字和java 随机汉字的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。
推荐阅读
- mongodb中lookup索引,mongo 查询索引
- 硬盘怎么分区显示文件损坏,硬盘隐藏的文件怎么显示
- 自回归模型chatgpt,自回归模型的形式和优缺点
- 慢动作跳车游戏,弹跳车游戏
- php语言如何连上数据库 php语言如何连上数据库
- ubuntu配置postgresql,ubuntu配置IP
- 视频为什么上传很模糊,为什么视频一上传就模糊
- 阿里云服务器dns解析,阿里云服务器dns解析失败
- php取json中数据 php解析json对象