Я пытаюсь обновить плитку приложения сгенерированным изображением. Я не получаю ошибок, но вместо этого цвета изображение просто черное: «Color.FromArgb (255, 0, 100, 50)». Любая идея почему?Сгенерированное изображение для плитки с неправильным цветом
//This have to be the Image, just a colored squer for the beginning
var TestTile = new Grid()
{
Background = new SolidColorBrush(Color.FromArgb(255, 0, 100, 50)),
HorizontalAlignment = HorizontalAlignment.Stretch,
VerticalAlignment = VerticalAlignment.Stretch,
Height = 336,
Width = 336,
Margin = new Thickness(0, 12, 0, 0),
};
//generation the image and save it within isoStorage
using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
{
if (!store.DirectoryExists("shared/shellcontent"))
{
store.CreateDirectory("shared/shellcontent");
}
var bitmap = new WriteableBitmap(336, 336);
bitmap.Render(TestTile, new TranslateTransform());
var stream = store.CreateFile("/shared/shellcontent/test.jpg");
bitmap.Invalidate();
bitmap.SaveJpeg(stream, 366, 336, 0, 100);
stream.Close();
}
// Tile Update
ShellTile PinnedTile = ShellTile.ActiveTiles.First();
FlipTileData UpdatedTileData = new FlipTileData
{
BackgroundImage = new Uri("isostore:/shared/shellcontent/test.jpg", UriKind.RelativeOrAbsolute),
};
PinnedTile.Update(UpdatedTileData);
Ok Я буду стараться использовать прямоугольник, чтобы задать цвет для фона – user3168511