set scale

This commit is contained in:
stubbfel
2013-08-13 10:50:31 +02:00
parent 39b292e3c3
commit d7c914eed6
4 changed files with 8 additions and 8 deletions

View File

@@ -68,12 +68,12 @@ namespace CampusAppWP8.Model.Campusmap
/// <summary>
/// Gets or sets the Scale (to pixel) of the map
/// </summary>
public double Scale { get; set; }
public double ScaleX { get; set; }
/// <summary>
/// Gets or sets the Scale (to pixel) of the map
/// </summary>
public double Ratio { get; set; }
public double ScaleY { get; set; }
/// <summary>
/// Gets or sets the reference point
@@ -164,7 +164,7 @@ namespace CampusAppWP8.Model.Campusmap
/// <returns>Point in pixel-size</returns>
public Point ConverToPixelPoint(double x, double y)
{
Point p = new Point { X = this.Scale * x, Y = (this.Scale * y) / this.Ratio};
Point p = new Point { X = this.ScaleX * x, Y = (this.ScaleY * y)};
return p;
}

View File

@@ -33,8 +33,8 @@ namespace CampusAppWP8.Model.Campusmap
this.ImageSource = Icons.Search;
this.ImageWidth = 60;
this.ImageHeight = 60;
this.PinImageOffsetX = -24;
this.PinImageOffsetY = -24;
this.PinImageOffsetX = -25;
this.PinImageOffsetY = -27;
}
#endregion

View File

@@ -39,8 +39,8 @@
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<TextBox Name="XPoint" Grid.Column="0" Text="14,322364" />
<TextBox Name="YPoint" Grid.Column="1" Text="51,765760725"/>
<TextBox Name="XPoint" Grid.Column="0" Text="14,327545" />
<TextBox Name="YPoint" Grid.Column="1" Text="51,767747"/>
<Button Grid.Column="2" Click="Button_Click">
<Image Source="{Binding Path=ThemelizedIcon.Search, Source={StaticResource ThemelizedIcons}}" Width="60"/>
</Button>

View File

@@ -11,7 +11,7 @@ namespace CampusAppWP8.Pages.Campusmap
public CampusMapPage()
{
InitializeComponent();
this.map = new MapModel() { ImageSource = "/Assets/campusmap.png", ImageWidth = 2000, ImageHeight = 1425, MapImageOffsetX = -228, MapImageOffsetY = -300, RefPoint = new Point(625, 900), Scale = 127118.6440677966, Ratio = 0.7125, GeoOffsetX = 14.32141, GeoOffsetY = 51.76599 };
this.map = new MapModel() { ImageSource = "/Assets/campusmap.png", ImageWidth = 2000, ImageHeight = 1425, MapImageOffsetX = -228, MapImageOffsetY = -300, RefPoint = new Point(1365, 800), ScaleX = 129483.4123222749, ScaleY = 197648.8919266073,GeoOffsetX = 14.327159, GeoOffsetY = 51.766548 };
this.MapCanvas.DataContext = map;
}