Redian新闻
>
有关BufferedImage width/height 的问题
avatar
有关BufferedImage width/height 的问题# Java - 爪哇娇娃
b*d
1
用 Image.getToolkit().getImage()读进一个 JPG 文件,用 image.getWidth()/
getHeight() 得到的width/height和实际图形的不一样。请问:如何能得到和实际图形一
样的width/height?多谢
avatar
g*g
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 的大作中提到】
: 用 Image.getToolkit().getImage()读进一个 JPG 文件,用 image.getWidth()/
: getHeight() 得到的width/height和实际图形的不一样。请问:如何能得到和实际图形一
: 样的width/height?多谢

avatar
b*d
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.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。