public class ImageTest {
public static void main(String[] args) throws IOException {
BufferedImage bufferedImage1 = ImageIO.read(new File("C:\\image_test\\tree.jpg"));
BufferedImage bufferedImage2 = ImageIO.read(new File("C:\\image_test\\star2.png"));
Graphics graphics1 = null;
try {
graphics1 = bufferedImage1.getGraphics();
int x = 2;
int y = 2;
graphics1.drawImage(bufferedImage2, x, y, null);
} finally {
graphics1.dispose();
}
ImageIO.write(bufferedImage1, "jpg", new File("C:\\image_test\\dst_jpg2.jpg"));
}
}
More than 3 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
00