-2

How can I achieve this one? I wanted to convert image into file example code is here.

Image image = webcam.getImage().getScaledInstance(image_label.getWidth(), image_label.getHeight(), Image.SCALE_SMOOTH);

I wanted to make it like

file = image;

so that I can write the image into file and store in a particular folder. thank you everyone!

  • 1
    [`ImageIO`](https://docs.oracle.com/javase/tutorial/2d/images/saveimage.html) - except you need convert the `Image` to `BufferedImage`, which isn't hard to do, for [example](https://stackoverflow.com/questions/32714751/how-to-convert-image-to-bufferedimage-in-java/32715012#32715012) – MadProgrammer May 16 '22 at 07:04
  • 1
    The linked tutorial will show you what you need - or you can google "imageio write image" – MadProgrammer May 16 '22 at 07:13

0 Answers0