mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 22:18:56 +00:00
ImageLoader
This commit is contained in:
parent
dfe3201625
commit
55d1ee933c
3 changed files with 27 additions and 23 deletions
|
|
@ -12,7 +12,7 @@ namespace MapControl
|
|||
{
|
||||
public static IImage LoadImage(Uri uri)
|
||||
{
|
||||
return null;
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public static IImage LoadImage(Stream stream)
|
||||
|
|
@ -25,17 +25,19 @@ namespace MapControl
|
|||
return Task.FromResult(LoadImage(stream));
|
||||
}
|
||||
|
||||
public static Task<IImage> LoadImageAsync(string path)
|
||||
public static async Task<IImage> LoadImageAsync(string path)
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
IImage image = null;
|
||||
|
||||
if (File.Exists(path))
|
||||
{
|
||||
return Task.FromResult<IImage>(null);
|
||||
using (var stream = File.OpenRead(path))
|
||||
{
|
||||
image = await LoadImageAsync(stream);
|
||||
}
|
||||
}
|
||||
|
||||
using (var stream = File.OpenRead(path))
|
||||
{
|
||||
return LoadImageAsync(stream);
|
||||
}
|
||||
return image;
|
||||
}
|
||||
|
||||
internal static async Task<IImage> LoadMergedImageAsync(Uri uri1, Uri uri2, IProgress<double> progress)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue