@@ -0,0 +1,2196 @@
+package virtualtour;%0Aimport javax.imageio.ImageIO;  %0Aimport java.awt.image.BufferedImage;  %0Aimport java.io.*;  %0Aimport java.awt.*;  %0A%0A/*  Pagalengineer.com  */%0A  %0Apublic class slice %7B  %0A    public static void main(String%5B%5D args) throws IOException %7B  %0A  %0A        File file = new File(%22D:/exif/images/test.jpg%22); // I have bear.jpg in my working directory  %0A        FileInputStream fis = new FileInputStream(file);  %0A        BufferedImage image = ImageIO.read(fis); //reading the image file  %0A  %0A        int rows = 1; //You should decide the values for rows and cols variables  %0A        int cols = 4;  %0A        int chunks = rows * cols;  %0A        String suffix=%22%22;%0A  %0A        int chunkWidth = image.getWidth() / cols; // determines the chunk width and height  %0A        int chunkHeight = image.getHeight() / rows;  %0A        int count = 0;  %0A        BufferedImage imgs%5B%5D = new BufferedImage%5Bchunks%5D; //Image array to hold image chunks  %0A        for (int x = 0; x %3C rows; x++) %7B  %0A            for (int y = 0; y %3C cols; y++) %7B  %0A                //Initialize the image array with image chunks  %0A                imgs%5Bcount%5D = new BufferedImage(chunkWidth, chunkHeight, image.getType());  %0A  %0A                // draws the image chunk  %0A                Graphics2D gr = imgs%5Bcount++%5D.createGraphics();  %0A                gr.drawImage(image, 0, 0, chunkWidth, chunkHeight, chunkWidth * y, chunkHeight * x, chunkWidth * y + chunkWidth, chunkHeight * x + chunkHeight, null);  %0A                gr.dispose();  %0A            %7D  %0A        %7D  %0A        System.out.println(%22Splitting done%22);  %0A        %0A        System.out.println(count);%0A  %0A  %0A        //writing mini images into image files  %0A        for (int i = 0; i %3C imgs.length; i++) %7B  %0A        %09switch(i)%0A        %09%7B%0A            case 0:  suffix = %22f%22;%0A        %09break;%0A            case 1:  suffix = %22r%22;%0A        %09break;%0A            case 2:  suffix = %22b%22;%0A        %09break;%0A            case 3:  suffix = %22l%22;%0A        %09break;%0A     %0A     %0A        %09%0A        %09%0A        %09%7D%0A        %09%0A            ImageIO.write(imgs%5Bi%5D, %22jpg%22, new File(%22d:/exif/images/%22,%22img_%22 + suffix + %22.jpg%22));  %0A            %0A        %7D  %0A        System.out.println(%22Mini images created%22);  %0A    %7D  %0A%7D  %0A

Create Slice.java