A difficult time creating the Microsoft Band icon
1 answer
If your Windows Phone app has an asset named "Assets / Icon1.png", then that asset can be turned into a BandIcon, for example:
using Microsoft.Band;
using Microsoft.Band.Tiles;
using Microsoft.Band.Tiles.Pages;
using Windows.Storage;
using Windows.Storage.Streams;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media.Imaging;
...
StorageFile imageFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/Icon1.png"));
using (IRandomAccessStream fileStream = await imageFile.OpenAsync(FileAccessMode.Read)
{
WriteableBitmap bitmap = new WriteableBitmap(1,1);
await bitmap.SetSourceAsync(fileStream);
return bitmap.ToBandIcon();
}
+7
source to share