mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Renamed GeoImage
This commit is contained in:
parent
abde6ad9fd
commit
41cd7c569d
7 changed files with 307 additions and 22 deletions
34
MapControl/WPF/GeoImage.WPF.cs
Normal file
34
MapControl/WPF/GeoImage.WPF.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
public partial class GeoImage : FrameworkElement
|
||||
{
|
||||
|
||||
|
||||
public BitmapSource Source
|
||||
{
|
||||
get { return (BitmapSource)GetValue(SourceProperty); }
|
||||
set { SetValue(SourceProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty SourceProperty =
|
||||
DependencyProperty.Register(nameof(Source), typeof(BitmapSource), typeof(GeoImage),
|
||||
new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
protected override void OnRender(DrawingContext drawingContext)
|
||||
{
|
||||
if (Source != null)
|
||||
{
|
||||
drawingContext.DrawImage(Source, new Rect(RenderSize));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue