I am working as a Spring MVC developer. My requirement is to set multiple small images on different positions over a big image.
For example I have a big image and some small images. I have the coordinates and height/width of the small images. I would like to set these small images on that big image over different coordinates. Finally I have to save the image with small images over it.
I have tried to play with buffered image but I actually didn't get how to do this. Please help me and provide any simple code to do this if possible.
Thank you in advance.
File f = new File(fullPath+"/"+imageHotSpot.getImageObject().getFilePath());
BufferedImage buff1 = ImageIO.read(f);
Graphics2D g2d = buff1.createGraphics();
File statusicon = new File(bigStatusIcon);
BufferedImage buff2 = ImageIO.read(statusicon);
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER));
g2d.drawImage(buff2, 10, 10,null);
g2d.dispose();
File outputfile = new File(fullPath+"/images/hotspotimages/image.jpg");
ImageIO.write(buff1, "jpg", outputfile);