/*** Java concatenate multiple images ** @ Param pics * @ Param type * @ Param dst_pic * @ return */public static Boolean Merge (string [] pics, string type, string dst_pic) {int Len = pics. length; If (LEN <1) {system. out. println ("pics Len <1"); Return false;} file [] src = new file [Len]; bufferedimage [] images = new bufferedimage [Len]; int [] [] imagearrays = new int [Len] []; for (INT I = 0; I <Len; I ++) {try {SRC [I] = new file (P ICS [I]); images [I] = ImageIO. read (SRC [I]);} catch (exception e) {e. printstacktrace (); Return false;} int width = images [I]. getwidth (); int Height = images [I]. getheight (); imagearrays [I] = new int [width * Height]; // read rgbimagearrays [I] = images [I] From the image. getrgb (0, 0, width, height, imagearrays [I], 0, width);} int dst_height = 0; int dst_width = images [0]. getwidth (); For (INT I = 0; I <images. length; I ++) {DST _ Width = dst_width> images [I]. getwidth ()? Dst_width: Images [I]. getwidth (); dst_height + = images [I]. getheight ();} system. out. println (dst_width); system. out. println (dst_height); If (dst_height <1) {system. out. println ("dst_height <1"); Return false;} // generate a new image. Try {// dst_width = images [0]. getwidth (); bufferedimage imagenew = new bufferedimage (dst_width, dst_height, bufferedimage. type_int_rgb); int height_ I = 0; For (INT I = 0; I <images. length; I ++) {imagenew. setrgb (0, height_ I, dst_width, images [I]. getheight (), imagearrays [I], 0, dst_width); height_ I + = images [I]. getheight () ;}file OUTFILE = new file (dst_pic); ImageIO. write (imagenew, type, OUTFILE); // write image} catch (exception e) {e. printstacktrace (); Return false;} return true ;}