有人可以向我解释,或指出一些不错的文章,我如何使用我的 Photoshop 设计并将其正确实施到我的应用程序中?我想为应用程序使用 Xaml/VB。我制作了一个不错的游戏设计,我想使用它,但我不明白如何将这个设计用于我的 xaml 应用程序。边框应始终位于屏幕的边框上。
图片样本:http ://social.msdn.microsoft.com/Forums/getfile/215154
亲切的问候
有人可以向我解释,或指出一些不错的文章,我如何使用我的 Photoshop 设计并将其正确实施到我的应用程序中?我想为应用程序使用 Xaml/VB。我制作了一个不错的游戏设计,我想使用它,但我不明白如何将这个设计用于我的 xaml 应用程序。边框应始终位于屏幕的边框上。
图片样本:http ://social.msdn.microsoft.com/Forums/getfile/215154
亲切的问候
最简单的方法是使用具有“从 Photoshop 导入”选项的 Blend。
在我给出答案之前,需要注意一件事:MS 设计指南建议您避免将自己的 chrome 添加到应用程序中 - 设计理念是您不需要这样做。
也就是说,您可以通过将图像分成 8 个部分并在应用程序 XAML 中具有覆盖网格来实现此目的。这类似于您可能希望在 HTML 中布置相同内容的方式。
<!-- content for the game here -->
<Grid Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="30" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition Height="*" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Image Height="30" Width="30" Source="TopLeftSlice.png" />
<Image Height="30" Grid.Column="1" Source="TopMiddleSlice.png" />
<Image Height="30" Width="30" Grid.Column="2" Source="TopRightSlice.png" />
<Image Width="30" Grid.Row="1" Source="MiddleLeftSlice.png" />
<Image Width="30" Grid.Row="1" Grid.Column="2" Source="MiddleRightSlice.png" />
<Image Height="30" Width="30" Grid.Row="2" Source="BottomLeftSlice.png" />
<Image Height="30" Grid.Row="2" Grid.Column="1" Source="BottomMiddleSlice.png" />
<Image Height="30" Width="30" Grid.Row="2" Grid.Column="2" Source="BottomRightSlice.png" />
</Grid>
您需要弄乱图像上的宽度、高度和拉伸属性以使它们看起来正确,但只要在您的页面上正确定义了这些属性,它就应该显示为覆盖,并且您之前定义的内容应该显示通过间隙/透明胶片。