El siguiente código usa Java para dividir la imagen en varias partes.
La copia del código es la siguiente:
SegmentationImage de la clase pública {
segmentación de icono estático público (String ImageName, int Ancho, int Height, int Height, int Ancho) arroja excepción {
// Prepárate para dividir la imagen
BufferedImage img1 = imageIO.Read (nuevo archivo (nombre de imagen));
int half_w = img1.getWidth ();
int rgb [] = new int [half_w*img1.getheight ()];
img1.getrgb (0, 0, half_w, img1.getheight (), rgb, 0, half_w);
BufferedImage img_half = new BufferedImage (half_w, img1.getheight (), bufferedimage.type_int_argb);
img_half.setrgb (ancho, altura, altura, img1.getheight (), rgb, ancho, half_w);
Icon returniCon = new ImageCon (img_half);
Return Returnicon;
}
}