在MediaLibrary中保存图像

mas*_*ake 3 image windows-phone-7 media-library

我正在使用列表框,我使用绝对uri填充列表框.现在我需要将图像保存到手机中的媒体库中.但是当我尝试:

Application.GetResourceStream(new Uri(imageurl, UriKind.absolute))
Run Code Online (Sandbox Code Playgroud)

它引发了一个例外.有没有办法解决这个问题.

提前致谢.

mas*_*ake 9

这是我发现的解决方案,它起作用:

        WebClient client = new WebClient();
        client.OpenReadCompleted += (s, e) =>
            {
                if (e.Error == null)
                {
                    MediaLibrary library = new MediaLibrary();
                    library.SavePicture(imageName, e.Result);
                }
            };
        client.OpenReadAsync(new Uri(imageAbsoluteUrl, UriKind.Absolute));
Run Code Online (Sandbox Code Playgroud)