我正在尝试开发一个应该像游戏一样的应用程序.用户在城市中会有一些位置,他必须在每个位置做一些事情.为了跟踪用户的位置,我尝试使用以下代码进行地理定位:
Geolocator geolocator = new Geolocator();
//geolocator.DesiredAccuracy = Windows.Devices.Geolocation.PositionAccuracy.High;
geolocator.DesiredAccuracyInMeters = 50;
try
{
Geoposition geoposition = await geolocator.GetGeopositionAsync(TimeSpan.FromMilliseconds(500), TimeSpan.FromSeconds(1));
textLatitude.Text = "Latitude: " + geoposition.Coordinate.Latitude.ToString("0.0000000000");
textLongitude.Text = "Longitude: " + geoposition.Coordinate.Longitude.ToString("0.0000000000");
textAccuracy.Text = "Accuracy: " + geoposition.Coordinate.Accuracy.ToString("0.0000000000");
}
Run Code Online (Sandbox Code Playgroud)
使用以下方法获取坐标我试图测试设备是否将使用以下代码正确定位我的位置:
if( Math.Abs(geoposition.Coordinate.Latitude - 45.3285) < 0.001 ){
if (Math.Abs(geoposition.Coordinate.Longitude - 14.4474) < 0.001)
{
txt.Text = "KONT";
}
}
Run Code Online (Sandbox Code Playgroud)
问题是位置的准确性非常小,如果我尝试使用更精确的坐标,它将永远不会再次获得相同的坐标,并且使用此代码,准确度非常差(甚至可能无法达到300米).
有谁知道如何获得更可靠的位置,或其他方法来解决这个问题?
我正在开发一个WP8.1应用程序,现在当我差不多完成它时,我试图运行Windows应用程序认证工具包来测试一切是否正常.我收到了这个错误:
我知道这不是一件大事(它应该很容易修复)但我想让图像变得更好.我在Assets文件夹中找到了默认的样本,但我真的不知道最后它们应该是什么样子.
有人可以为我提供以下图像的一些样本(可能是他使用的一些样本):
ApplicationIcon.png
BadgeLogo.png
Logo.png
SplashScreen.png
SquareTile71x71.png
SquareTile150x150.png
StoreLogo.png
WideLogo.png
Run Code Online (Sandbox Code Playgroud)
Tiles文件夹中也在Assets文件夹中的那些:
FlipCycleTileLarge.png
FlipCycleTileMedium.png
FlipCycleTileSmall.png
IconicTileMediumLarge.png
IconicTileSmall.png
Run Code Online (Sandbox Code Playgroud)
PS我会制作自己的照片(如果你愿意,我可以稍后发布)但我想看一些例子来了解它应该是什么样的.
我使用此代码获得全屏图像:
<phone:PhoneApplicationPage
x:Class="solution.FullScreenViewer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
mc:Ignorable="d"
shell:SystemTray.IsVisible="True">
<Image Name="img" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"Stretch="Uniform"/>
</phone:PhoneApplicationPage>
Run Code Online (Sandbox Code Playgroud)
这只是一个更大项目的一部分.我想在点击它之后实现te feture以全屏打开图像,所以我用另一个图像制作了另一个页面.我正在使用以下代码从C#加载图像:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
string context = this.NavigationContext.QueryString["context"];
img.Source = new BitmapImage(new Uri(context, UriKind.RelativeOrAbsolute));
base.OnNavigatedTo(e);
}
Run Code Online (Sandbox Code Playgroud)
现在我想添加一个缩放图片的选项,但我不知道如何.我也尝试了谷歌,但我发现的唯一一件事是在ScroolViewer中使用ZoomMode,这对我不起作用(它说成员ZoomMode无法识别).
还有其他解决方案可以放大吗?