[java] Image into Image

Started by
1 comment, last by bigryanjoel 18 years, 11 months ago
Hi I have to images of type java.awt.Image. I want to know if there is a simple way to combine them. Ie. imageA.drawImage(imageB, xCoord, yCoord); I know it is not this simple but how would you do it?
Advertisement
It is almost that easy:
//Create an off-screen image matching imageA in sizeImage buffer = new BufferedImage (imageA.getWidth (observer), imageA.getHeight (observer), BufferedImage.TYPE_INT_BGR);//Get the Graphics object from itGraphics b = buffer.getGraphics ();//Copy imageA onto itb.drawImage (imageA, 0, 0, observer);//Copy imageB onto itb.drawImage (imageB, xCoord, yCoord, observer)'
Kippesoep
Thanks I'll try that out.

This topic is closed to new replies.

Advertisement