Version 4.12. Added MapControl.Images project

This commit is contained in:
ClemensF 2018-12-14 18:37:21 +01:00
parent f585377c34
commit 05a995c592
2 changed files with 12 additions and 15 deletions

View file

@ -11,8 +11,8 @@
<AssemblyName>MBTiles.UWP</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17763.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17134.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

View file

@ -29,16 +29,6 @@ namespace MapControl.Images
"Path", typeof(string), typeof(WorldFileImage),
new PropertyMetadata(null, async (o, e) => (await ReadWorldFileImage((string)e.NewValue)).SetImage((Image)o)));
public static string GetPath(Image image)
{
return (string)image.GetValue(PathProperty);
}
public static void SetPath(Image image, string path)
{
image.SetValue(PathProperty, path);
}
public BitmapSource Bitmap { get; }
public Matrix Transform { get; }
public MapProjection Projection { get; }
@ -77,6 +67,16 @@ namespace MapControl.Images
};
}
public static string GetPath(Image image)
{
return (string)image.GetValue(PathProperty);
}
public static void SetPath(Image image, string path)
{
image.SetValue(PathProperty, path);
}
public static async Task<WorldFileImage> ReadWorldFileImage(string imagePath, string worldFilePath, string projFilePath = null)
{
BitmapSource bitmap;
@ -181,9 +181,6 @@ namespace MapControl.Images
return image;
}
/// <summary>
/// Experimental
/// </summary>
public static async Task<FrameworkElement> CreateImage(string imagePath)
{
return (await ReadWorldFileImage(imagePath)).CreateImage();