コード例 #1
0
        private async Task <BitmapImage> getImage(Uri uri)
        {
            //StorageFile file = await StorageFile.GetFileFromPathAsync(uri.AbsoluteUri);

            //IRandomAccessStreamReference thumbnail = RandomAccessStreamReference.CreateFromUri(uri);
            //StorageFile file = await StorageFile.CreateStreamedFileFromUriAsync("duyuru.jpg", uri, thumbnail);

            Stream stream = await Define.DownloadStreamAsync(new Uri("http://www.adobe.com/content/dam/Adobe/en/products/acrobat/pdfs/adobe-acrobat-xi-esign-pdf-file-tutorial-ue.pdf"));

            BitmapImage  bitmapImage = new BitmapImage();
            MemoryStream ms          = new MemoryStream();

            stream.CopyTo(ms);
            IRandomAccessStream a1 = await ConvertToRandomAccessStream(ms);

            await bitmapImage.SetSourceAsync(a1);

            return(bitmapImage);
        }