0

我正在使用来自https://www.windowsazure.com/en-us/develop/net/how-to-guides/blob-storage/#configure-access的 blob 教程中的以下代码

我成功地将图像上传到 blob 存储中。

        CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
RoleEnvironment.GetConfigurationSettingValue("BlobConnectionString"));

// Create the blob client
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();

// Retrieve reference to a previously created container
CloudBlobContainer container = blobClient.GetContainerReference("mycontainer");

// Retrieve reference to a blob named "myblob"
CloudBlob blob = container.GetBlobReference("myblob");

        BlobStream blobstream = blob.OpenRead();

        objimg =  System.Drawing.Image.FromStream(blobstream, true);   

我正在尝试从 blob 中检索图像并将其存储在 objimg 中,稍后将在 UI 中使用它。

但是,当执行到“System.Drawing.Image.FromStream”时,页面卡住显示等待状态。

为什么会这样?在视图中“window.setInterval”应该调用一个控制器函数来返回获得的图像。我应该如何将它发送到视图并在视图中设置它?

谢谢,阿尼尔

4

0 回答 0