Uri uri = new Uri("http://w...content-available-to-author-only...o.jp/intl/ja_jp/images/logo.gif");
using (WebClient web = new WebClient())
using (BufferedStream imgData = new BufferedStream(web.OpenRead(uri)))
using (MemoryStream memory = new MemoryStream())
{
int data = -1;
while ((data = imgData.ReadByte()) != -1)
{
memory.WriteByte((byte)data);
}
memory.Seek(0, SeekOrigin.Begin);
BitmapImage bi = new BitmapImage();
bi.BeginInit();
bi.CacheOption = BitmapCacheOption.OnLoad;
bi.StreamSource = memory;
bi.EndInit();
image.Source = bi;
}
ICAgICAgICAgICAgVXJpIHVyaSA9IG5ldyBVcmkoImh0dHA6Ly93Li4uY29udGVudC1hdmFpbGFibGUtdG8tYXV0aG9yLW9ubHkuLi5vLmpwL2ludGwvamFfanAvaW1hZ2VzL2xvZ28uZ2lmIik7CgogICAgICAgICAgICB1c2luZyAoV2ViQ2xpZW50IHdlYiA9IG5ldyBXZWJDbGllbnQoKSkKICAgICAgICAgICAgdXNpbmcgKEJ1ZmZlcmVkU3RyZWFtIGltZ0RhdGEgPSBuZXcgQnVmZmVyZWRTdHJlYW0od2ViLk9wZW5SZWFkKHVyaSkpKQogICAgICAgICAgICB1c2luZyAoTWVtb3J5U3RyZWFtIG1lbW9yeSA9IG5ldyBNZW1vcnlTdHJlYW0oKSkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgaW50IGRhdGEgPSAtMTsKICAgICAgICAgICAgICAgIHdoaWxlICgoZGF0YSA9IGltZ0RhdGEuUmVhZEJ5dGUoKSkgIT0gLTEpCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgbWVtb3J5LldyaXRlQnl0ZSgoYnl0ZSlkYXRhKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIG1lbW9yeS5TZWVrKDAsIFNlZWtPcmlnaW4uQmVnaW4pOwoKICAgICAgICAgICAgICAgIEJpdG1hcEltYWdlIGJpID0gbmV3IEJpdG1hcEltYWdlKCk7CiAgICAgICAgICAgICAgICBiaS5CZWdpbkluaXQoKTsKICAgICAgICAgICAgICAgIGJpLkNhY2hlT3B0aW9uID0gQml0bWFwQ2FjaGVPcHRpb24uT25Mb2FkOwogICAgICAgICAgICAgICAgYmkuU3RyZWFtU291cmNlID0gbWVtb3J5OwogICAgICAgICAgICAgICAgYmkuRW5kSW5pdCgpOwoKICAgICAgICAgICAgICAgIGltYWdlLlNvdXJjZSA9IGJpOwogICAgICAgICAgICB9Cg==