In fact, the central picture of small program code can not be customized, using the basic information in the small program head. So, don't think about customizing things. But we can do some work on the generated small code to achieve this effect, the use is actually Java graphics2d drawing. The process is as follows:
1, generate small program code, see this blog Java generate unrestricted with parameter small program code
2, 1 steps to obtain a small code picture, to prepare a size and center size more appropriate picture, the following code is used to replace the central area of the
public class Test {public static void main (string[] args) {try {bufferedimage Apple
timg = Imageio.read (New FileInputStream ("D:\\applet.png"));
Graphics2D g2d = Appletimg.creategraphics ();
Set anti-aliasing properties G2d.setrenderinghint (renderinghints.key_antialiasing, renderinghints.value_antialias_on);
G2d.setrenderinghint (renderinghints.key_text_antialiasing, renderinghints.value_text_antialias_on);
BufferedImage centerimg = Imageio.read (New File ("D:\\center.png")); G2d.drawimage (Centerimg.getscaledinstance (Centerimg.getwidth (), Centerimg.getheight (), Image.SCALE_SMOOTH), (
Appletimg.getwidth ()-centerimg.getwidth ())/2, (Appletimg.getheight ()-centerimg.getheight ())/2, NULL);
Close resource G2d.dispose ();
Imageio.write (appletimg, "PNG", New File ("D:\\newapplet.png"));
catch (Exception e) {e.printstacktrace (); }
}
}