重新调整图像大小?

时间:2011-04-29 12:47:35

标签: java image-processing

如何在缩小或扩展时保留图像的分辨率......有没有办法......

1 个答案:

答案 0 :(得分:2)

你应该在这里检查,存在同样的问题:

http://forums.oracle.com/forums/thread.jspa?threadID=1270008

那里提供的解决方案:

TIFFEncodeParam tep = new TIFFEncodeParam();

// Create {X,Y}Resolution fields.
TIFFField fieldXRes = new TIFFField(0x11A, TIFFField.TIFF_RATIONAL,
                                1, new long[][] {{DPI_X, 1}});
TIFFField fieldYRes = new TIFFField(0x11B, TIFFField.TIFF_RATIONAL,
                                1, new long[][] {{DPI_Y, 1}});
tep.setExtraFields(new TIFFField[] {fieldXRes, fieldYRes});