3
我想制作一个应用程序,如this one。该应用程序可以使用文本制作拼贴。如何在Windows Phone应用程序中从StackPanel制作位图图像
我发现我无法轻松写入文本,因为StandardTileData类不具备写入文本的功能。 StandardTileData类仅用于设置标题,背景图像,计数等。示例是这样的。
StandardTileData secondaryTile = new StandardTileData
{
BackgroundImage = new Uri("/TileColors..png", UriKind.Relative),
Title = "title",
Count = null,
};
ShellTile.Create(new Uri("/MainPage.xaml?id=1", UriKind.Relative), secondaryTile);
所以,我认为我们可能需要使位图图像包含文本。我没有其他好主意。 有谁知道如何从堆叠面板制作位图图像?
我的代码是这样的,
<StackPanel Height="173" Width="173" x:Name="TilePanel" Background="Wheat" >
<TextBlock x:Name="tileText" Text="I'd like to add the text to a tile." Style="{StaticResource PhoneTextNormalStyle}" HorizontalAlignment="Left" FontSize="20"/>
</StackPanel>