我想獲得的圖像DPI轉換像素釐米,所以我用ImageInfo.java得到這個:的imageinfo不包含有效值
ImageInfo myMapInfo = new ImageInfo();
try {
File testFile = new File(fileNameString);
InputStream myMapStream = new FileInputStream(testFile);
myMapInfo.setInput(myMapStream);
myMapInfo.setDetermineImageNumber(true);
myMapInfo.setCollectComments(true);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
x = myMapInfo.getPhysicalWidthInch();
y = myMapInfo.getPhysicalHeightInch();
但不幸的是我得到-1 -1(x,y)!我使用這個類: ImageInfo.java
我使用sanselan jar庫,它的工作原理... –