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

@ -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();