在Wp8中如何制作透明的Png格式的桌面磁贴
我目前用的是ImagesTools上的方法 不知道大家还有没有其他的方法?
public void SavePng(UIElement canvas ,string filepath)
{
try
{
ExtendedImage exelent = canvas.ToImage();//CustomWideBackTile
string path = string.Format("/Shared/ShellContent/{0}.png", filepath);
using (IsolatedStorageFile iso = IsolatedStorageFile.GetUserStoreForApplication())
{
using (IsolatedStorageFileStream tileStream = iso.CreateFile(path))
{
exelent.WriteToStream(tileStream, path);
tileStream.Dispose();
tileStream.Close();
exelent = null;
canvas = null;
}
}
}
catch (Exception)
{
return ;
}
}
爱编程 爱生活