如何从xml文件url内部链接解析图像。当我解析数据时,它会向我显示除了显示图像之外的链接。这是图像http://www.worldweatheronline.com/images/wsymbols01_png_64/wsymbol_0001_sunny.png
的链接和链接i解析数据来自
答案 0 :(得分:1)
以下是从网址制作缓冲图片的代码。
try {
URL url = new URL("http://www.worldweatheronline.com/images/wsymbols01_png_64/wsymbol_0001_sunny.png");
BufferedImage bufferedImage = ImageIO.read(url);
ImageIO.write(bufferedImage, "png", new FileOutputStream("/home/visruth/OutputImage.png"));// A file named OutputImage.png will be created in the location /home/visruth/
} catch(Exception e) {
e.printStackTrace();
}