从网络获取图像

本文关键字:图像 获取 网络 | 更新日期: 2023-09-27 18:08:02

我将解释我要做什么:让我们以这张照片为例。我想下载这张图片并在我的应用程序中打开它,使用图片框。我想我需要使用
Bitmap bitmap = new Bitmap(xxxx);我应该在"xxxx"这个地方放什么?我看到的脚本是用Delphi写的,看起来像这样:

Value := copys (searchPage, '<link rel="image_src" href="', '">');
GetPicture (Value);

任何建议吗?

从网络获取图像

Image i = new Image();
BitmapImage src = new BitmapImage();
src.BeginInit();
src.UriSource = new Uri("https://i.stack.imgur.com/glbMA.jpg");
src.EndInit();
i.Source = src;