/** * Image Overlay (Overlay map compressed to width*height size, overlay to bottom) * * @param basefilepath basemap * @param coverfilepath Overlay * @param x Start x axis * @param Y Start y axis * @param width cover Width * @param height coverage length * @return * @throws Exception */public static bufferedimage coverimage (S Tring Basefilepath, String coverfilepath, int x, int y, int width, int height) throws Exception{file basefile = new File (b Asefilepath);//basemap BufferedImage buffimg = Imageio.read (basefile); File Coverfile = new file (Coverfilepath); Cover layer BufferedImage coverimg = Imageio.read (coverfile); buffimg = Coverimage (buffimg, coverimg, x, y, width, height); return buffimg;}
/** * Image Overlay (Overlay map compressed to width*height size, overlay to bottom) * * @param basebufferedimage basemap * @param coverbufferedimage Overlay * @param x Start x Axis * @param y start y axis * @param width cover Width * @param height coverage length * @return * @throws Exception */public static BufferedImage Co Verimage (BufferedImage basebufferedimage, bufferedimage coverbufferedimage, int x, int y, int width, int height) throws Ex ception{//Create the Graphics2D object, use the Basemap object to draw graphics2d g2d = Basebufferedimage.creategraphics ();//Draw G2d.drawimage ( Coverbufferedimage, x, y, +, NULL); G2d.dispose ();//release system resources used by the graphics context return basebufferedimage;}
Java uses graphics2d picture overlay