public Task <Stream> Load(string name)
 {
     return(_worker.Do(async() =>
     {
         using (var rawZip = _imageBundle.GetEntry(name)
                             .Open())
         {
             var result = new MemoryStream();
             await rawZip.CopyToAsync(result);
             result.Seek(0, SeekOrigin.Begin);
             return (Stream)result;
         }
     }));
 }
Esempio n. 2
0
 public async Task <Slide> Inflate([NotNull] Slide slide)
 {
     if (string.IsNullOrEmpty(slide.BackgroundImageName))
     {
         return(slide);
     }
     using (var stream = await slide.ImageData.Load(slide.BackgroundImageName))
     {
         using (var slideImageData = stream.AsRandomAccessStream())
         {
             slide.Background = await _uiThread.Do(() => _CreateImage(slideImageData));
         }
     }
     return(slide);
 }