mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 06:26:41 +00:00
GroundOverlay, ImageLoader
This commit is contained in:
parent
cd31f45feb
commit
733da9f231
3 changed files with 14 additions and 12 deletions
|
|
@ -48,13 +48,20 @@ namespace MapControl
|
|||
|
||||
if (entry != null)
|
||||
{
|
||||
MemoryStream memoryStream;
|
||||
|
||||
// ZipArchive does not support multithreading, synchronously copy ZipArchiveEntry stream to MemoryStream.
|
||||
//
|
||||
using (var zipStream = entry.Open())
|
||||
using (var memoryStream = new MemoryStream((int)zipStream.Length))
|
||||
{
|
||||
zipStream.CopyTo(memoryStream); // CopyToAsync won't work with ZipArchive
|
||||
memoryStream = new MemoryStream((int)zipStream.Length);
|
||||
zipStream.CopyTo(memoryStream);
|
||||
memoryStream.Seek(0, SeekOrigin.Begin);
|
||||
imageSource = await ImageLoader.LoadImageAsync(memoryStream);
|
||||
}
|
||||
|
||||
// Close Zip Stream before awaiting.
|
||||
//
|
||||
imageSource = await ImageLoader.LoadImageAsync(memoryStream);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue