[英]VB.NET Picturebox image from url
Im trying to load images from a url to a picturebox but I can't get it to work. 我试图将图像从url加载到图片框,但无法正常工作。 The url of the page is " http://www.example.com/storage/image?12345 " but the picture box doesnt load it.
页面的网址为“ http://www.example.com/storage/image?12345 ”,但图片框未加载它。 And here is the source code of a page where the image are on.
这是图像所在页面的源代码。 This is the whole code of the webpage and it's using php code that i dont have access.
这是网页的整个代码,它使用的是我无法访问的php代码。
<html>
<body>
<img style = "-webkit-user-select: none" src = "http://www.example.com/storage/image?12345">
</body>
</html>
My question now is how can i get it to work using the given url. 我的问题现在是如何使用给定的URL使它正常工作。 But when I try to get image in other website like in google image.
但是,当我尝试在其他网站中获取图片时,例如在Google图片中。 it was working fine.
工作正常。 i hope someone can help me out of this.
我希望有人可以帮助我。 thnx
n
I'm assuming you're using a desktop application. 我假设您正在使用桌面应用程序。 What you should do is to use WebClient to download the image as a byte array and then convert the byte array into a BitMap which you can assign to the PictureBox
您应该使用WebClient下载图像作为字节数组,然后将字节数组转换为可以分配给PictureBox的BitMap。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.