次のコードでは、Javaを使用して画像をいくつかの部分に分割してください。
コードコピーは次のとおりです。
パブリッククラスのセグメンテーションイメージ{
public staticアイコンセグメンテーション(String Imagename、int width、int height、int height、int width)スロー例外{
//画像を分割する準備をします
BufferedImage IMG1 = ImageIo.Read(new File(Imagename));
int half_w = img1.getWidth();
int rgb [] = new int [half_w*img1.getheigh()];
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(幅、高さ、高さ、img1.getheigh()、rgb、width、half_w);
Icon Returnicon = new ImageIcon(IMG_HALF);
Returnicon;
}
}