如何使用 vb.net 将 Dropbox 中的图片插入图片框?

How to insert image from dropbox into picture box using vb.net?

我想使用 vb.net 将来自 Dropbox 的图像插入到图片框中。我需要任何声明才能获取图像吗?下面的代码正确吗?

PictureBox1.ImageLocation = ("https://www.dropbox.com/sh/ygv9rcyh3mau9iq/AACMZkQk1LjJQtHhHfnQtJnya?dl=0")

谢谢。

问候 贝拉

右击你的图片并获取完整图片link。 使用网络客户端下载图片。 将其转换为图像并显示:

Dim wc as WebClient = new WebClient()
Dim link as String = "https://photos-2.dropbox.com/t/2/AACerj-io8r78s9wMuMj89u6oImFJ3DBeSkMCqTdCHNh3g/12/251283012/jpeg/32x32/3/1501606800/0/2/Red.jpg/EJuPkuUBGEIgAigCKAQ/UMjbxEdbmCCNu2OKt_ilUDfYTahaFP6-V2bmbT4g6pM?dl=0&size=1600x1200&size_mode=3"
Dim mem as new MemoryStream(wc.DownloadData(link ))
Dim img as Bitmap = Bitmap.FromStream(mem )
PictureBox1.Image = img