我正在尝试重新缩放一组图像,以使它们都具有相同的宽度和高度。我无法返回数组。任何帮助都会很棒。
public static Picture[] resize(Picture[] slides, String[] args) {
int w = 298;
int h = 298;
Picture [] source = new Picture [Integer.parseInt(args[0])];
for ( int ti = 0; ti < w; ti++){
for (int tj = 0; tj < h; tj++){
Picture [] target = new Picture[ti+1];
int si = tj * source[ti].width()/w;
int sj = tj * source[tj].height()/h;
target[ti].set(ti, tj, source[0].get(si, sj));
}
}
return target;
}