b*********d 发帖数: 20 | 1 用 Image.getToolkit().getImage()读进一个 JPG 文件,用 image.getWidth()/
getHeight() 得到的width/height和实际图形的不一样。请问:如何能得到和实际图形一
样的width/height?多谢 | g*****g 发帖数: 34805 | 2 No idea, but you can show the image to see what's wrong
public ImageViewer(Image image) {
this.image = image;
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
setSize(image.getWidth(null) + 100, image.getHeight(null) +
100);
show();
}
"
the
.
【在 b*********d 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 用 Image.getToolkit().getImage()读进一个 JPG 文件,用 image.getWidth()/ : getHeight() 得到的width/height和实际图形的不一样。请问:如何能得到和实际图形一 : 样的width/height?多谢
| b*********d 发帖数: 20 | 3 Thanks first. I have alreay used MediaTracker. The package I used is called "
ImageUtilities" found from Internet. But width and height are not same as the
real ones. Moreover, width = height. Could you give some suggestions? Thanks. |
|