mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 22:46:58 +00:00
GeoImage implementation
This commit is contained in:
parent
1f5e82518a
commit
07849eb1d8
4 changed files with 86 additions and 54 deletions
|
|
@ -6,11 +6,32 @@ using System;
|
|||
using System.Threading.Tasks;
|
||||
using Windows.Graphics.Imaging;
|
||||
using Windows.Storage;
|
||||
#if UWP
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Media;
|
||||
#else
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
public partial class GeoImage
|
||||
public partial class GeoImage : Grid
|
||||
{
|
||||
private void SetImage(ImageSource image)
|
||||
{
|
||||
Children.Clear();
|
||||
Children.Add(new Image
|
||||
{
|
||||
Source = image,
|
||||
Stretch = Stretch.Fill,
|
||||
HorizontalAlignment = HorizontalAlignment.Stretch,
|
||||
VerticalAlignment = VerticalAlignment.Stretch
|
||||
});
|
||||
}
|
||||
|
||||
private static async Task<GeoBitmap> ReadGeoTiffAsync(string sourcePath)
|
||||
{
|
||||
var file = await StorageFile.GetFileFromPathAsync(FilePath.GetFullPath(sourcePath));
|
||||
|
|
@ -60,7 +81,7 @@ namespace MapControl
|
|||
if (metadata.TryGetValue(geoKeyDirectoryQuery, out BitmapTypedValue geoKeyDirValue) &&
|
||||
geoKeyDirValue.Value is short[] geoKeyDirectory)
|
||||
{
|
||||
geoBitmap.SetProjection(geoKeyDirectory);
|
||||
geoBitmap.Projection = GetProjection(geoKeyDirectory);
|
||||
}
|
||||
|
||||
return geoBitmap;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue