C# 如何在windows phone中放置xaml控件以在辅助磁贴中显示?
我想为我的windows phone应用程序创建一个辅助互动程序,它在我的主页中显示控件,例如,如何显示要在辅助互动程序中显示的面板控件(其中包含图像)C# 如何在windows phone中放置xaml控件以在辅助磁贴中显示?,c#,windows-phone-7.1,C#,Windows Phone 7.1,我想为我的windows phone应用程序创建一个辅助互动程序,它在我的主页中显示控件,例如,如何显示要在辅助互动程序中显示的面板控件(其中包含图像) public void CreateSecondaryTile() { ShellTile secTile = ShellTile.ActiveTiles.SingleOrDefault(x => x.NavigationUri.ToString().Contains("MainPage.xaml"));
public void CreateSecondaryTile()
{
ShellTile secTile = ShellTile.ActiveTiles.SingleOrDefault(x => x.NavigationUri.ToString().Contains("MainPage.xaml"));
if (secTile == null)
{
StandardTileData fullTile = new StandardTileData()
{
//'*** Primary Tile Properties ***
BackgroundImage = new Uri(controlName, UriKind.Relative),
Count = DateTime.Now.Second,
Title = "Front Title",
//'*** Secondary Tile Properties ***
BackBackgroundImage = new Uri("Background.png", UriKind.Relative),
BackContent = "Back Content",
BackTitle = "Back Title"
};
ShellTile.Create(new Uri("/MainPage.xaml", UriKind.Relative), fullTile);
}
从控件生成图像的步骤 //////执行渲染和存储图像/// ///呈现UIElement///Uri以存储图像私有静态void RenderAndStoreImage(UIElement元素,字符串uri){try{var writeableBitmap=新的writeableBitmap(173173); Render(元素,新TranslateTransform()) } 创建次平铺的步骤
Cna我们在里面放置一个马赛克图块作为辅助图块,看起来像windows phone中的人物图块。不,您受到图像引用的限制。但是您可以尝试从后台工作人员生成/更新此图像,使其看起来像马赛克。在windows phone 8中,将有更多选项。谢谢您的回复!我理解场景先生,请投票表决我的问题,如果你考虑的话,这是有用的…
using (var store = IsolatedStorageFile.GetUserStoreForApplication())
{ using (var stream = store.OpenFile(uri, FileMode.OpenOrCreate))
{
writeableBitmap.Invalidate();
writeableBitmap.SaveJpeg(stream, 173, 173, 0, 100); } } } catch (Exception ex) { Logger.Log(ex); }