public static void main(String[] args)
{
BufferedImage image = new BufferedImage(60, 45, BufferedImage.TYPE_INT_RGB);
Graphics2D g = image.createGraphics();
g.setBackground(Color.BLACK);
g.setFont(new Font("楷体", Font.BOLD, 45));
g.setColor(Color.WHITE);
g.drawString("福", 2, image.getHeight() - 2);
int[] rgb = image.getRGB(0, 0, image.getWidth(), image.getHeight(), new int[image.getWidth() * image.getHeight()],
0,image.getWidth());
for (int i = 0; i < image.getHeight(); i++)
{
for (int j = 0; j < image.getWidth(); j++)
{
if (rgb[i * image.getWidth() + j] == -1)
{
System.out.print("$$");
} else
{
System.out.print(" ");
}
if (j == image.getWidth() - 1)
{
System.out.println();
}
}
}
}