I want to use the 2D Java API to draw on a JLabel that already has an image, and then save the resulting edited image.
I cannot find tutorials on this particular issue, does anyone have any code or links that show how to do this?
One approach would be to make an existing image and drawing in BufferedImage, as shown in this, which overlays the text on the logo. After completing the image, use ImageIO.write()to save it in the desired format.
BufferedImage
ImageIO.write()
paintComponent JLabel. super.paintComponent, JLabel, . :
paintComponent
JLabel
super.paintComponent
public void paintComponent(Graphics g){ super.paintComponent(g) g.drawWhatever ... }