Adding/override one image to another image at specific position?
Domanda
I want to add an image to another image at specific position either it would be pixels or cm or (x,y). I have to do it by java programming using JAI(Java Advanced Imaging).
I googled to get sample code.
I got replacing ,adding at the end only.But not at specific position.
Any idea is appreciatable.
Laxman chowdary
Soluzione
BufferedImage sourceImage = ImageIO.read("myImage");
BufferedImage overlayImage = ImageIO.read("myOverlay");
Graphics2D g2Source = sourceImage.createGraphics();
g2Source.drawImage(overlayImage, x, y, null);
g2Source.dispose();
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow