嗨,我有一个使用 Silverlight API 的 Windows Phone 8.1 应用程序。
我正在从我的 Blob 存储中下载这个图像。
该图像来自于这样的链接:https://[service].blob.core.windows.net/[imagename].png,并且可以在多个浏览器中显示和下载,只需使用 URI。
现在,我想根据 Blob 存储中的 ImageURI 使用它作为 ImageBrush。
// If we have a returned SAS.
BitmapImage myOnlineImage = new BitmapImage();
myOnlineImage.UriSource = new Uri(uploadImage.ImageUri, UriKind.RelativeOrAbsolute);
//ImageOnlineTest.Source = myOnlineImage;
var imageBrush = new ImageBrush
{
ImageSource = myOnlineImage,
Stretch = Stretch.None
};
var source = FindChildShieldCanvas(CanvasImage, imageBrush);
WriteableBitmap wbm = new WriteableBitmap((BitmapImage)myOnlineImage);
ImageOnlineTest.Source = wbm;
myOnlineImage
没有正确创建,至少我无法将图像转换为可写的位图图像(从转换中获取空异常),而且图像刷为空,即null。但据我所知,这是正确的方法?基本上,如何基于https站点的url创建imagebrush
?
BeginInit
和EndInit
? - JTIM