Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.image.BufferedImage;
import java.io.File;

import javax.imageio.ImageIO;

public class Main {

    public static void main(String[] args) throws Exception {
        BufferedImage original = new BufferedImage(100, 100, BufferedImage.TYPE_3BYTE_BGR);

        BufferedImage copy = original.getSubimage(10, 10, 50, 50);

        ImageIO.write(copy, "png", new File("Test.png"));
    }

}