W10 Mobile 提供扩展启动画面。我使用 Template10 和他们的指南来制作扩展的闪屏。我有 3 张尺寸的图片:620x300
, 1240x600
, 2480x1200px
. 扩展的启动画面工作正常,但我想从中心到底部为图像设置动画。这是设置图像的代码:
SplashScreenImage.SetValue(Canvas.LeftProperty, SplashScreen.ImageLocation.X);
SplashScreenImage.SetValue(Canvas.TopProperty, SplashScreen.ImageLocation.Y);
if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
{
SplashScreenImage.Height = SplashScreen.ImageLocation.Height / ScaleFactor;
SplashScreenImage.Width = SplashScreen.ImageLocation.Width / ScaleFactor;
}
else
{
SplashScreenImage.Height = SplashScreen.ImageLocation.Height;
SplashScreenImage.Width = SplashScreen.ImageLocation.Width;
}
高度为 731 有效像素,宽度为 411 有效像素。但图像居中,我想获得居中图像的大小。我不确定 Windows 会做什么以及它是否会缩放图像。