City0

来源:互联网 发布:游戏编程之从零开始 编辑:程序博客网 时间:2024/04/29 18:41
int width = 300;int height = 260;BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);Graphics2D graphic = image.createGraphics();image = graphic.getDeviceConfiguration().createCompatibleImage(width, height, Transparency.TRANSLUCENT);graphic.dispose();graphic = image.createGraphics();graphic.setFont(new Font("宋体", Font.BOLD, 20));graphic.setColor(new Color(100, 100, 100));String content[] = { "┏┯┓┏┯┓┏┯┓", "┠石┨┠头┨┠城┨", "┗┷┛┗┷┛┗┷┛", "╭⌒╮¤", "╭╭ ⌒╮ ●╭○╮","╰ ----╯/█∨█\\","~~~~~~~~~~∏~~∏~~~~~~~~~~~.", "╔════════════════╗", "║ ╱ヾ 属于我的世界 ひ我的快乐 ヾ ║", "╚════════════════╝" };for (int i = 0; i < 7; i++)graphic.drawString(content[i], 60, 30 + i * 20);graphic.setFont(new Font("楷体", Font.ITALIC, 16));graphic.setColor(new Color(200, 120, 60));System.out.println(content.length);for (int i = 7; i < content.length; i++)graphic.drawString(content[i], 10, 60 + i * 20);graphic.dispose();ImageIO.write(image, "png", new File("I:/test.png"));


	
				
		
原创粉丝点击