2
我正在尝试为我的Windows Phone 8应用程序制作一些美味的活动磁贴操作。我选择使用Cycle Tile
模板来制作一些非常漂亮的滑动图像,但存在一个问题:Microsoft似乎已经为所有图像添加了灰色半透明滤镜,以便底部的标题文本即使在白色的图像。如果开发人员打算使用WritableBitmap
来制作Metro风格的拼贴画,这很烦人。白人出来,为类白色灰度和主题颜色是阴影比所有其他瓦片较暗:CycleTile在我的图片窗口电话上放一个阴影
(在视觉树中一个用户控件)代码:
const double TILE_H = 336;
const double TILE_W = 691;
Size TILE_SIZE = new Size(TILE_W, TILE_H);
const string FILEDIREC = "/Shared/ShellContent";
LayoutRoot.Height = TILE_H;
LayoutRoot.Width = TILE_W;
LayoutRoot.Clip = new RectangleGeometry() { Rect = new Rect(new Point(), TILE_SIZE) };
LayoutRoot.Background = new SolidColorBrush(
((Color)Application.Current.Resources["PhoneAccentColor"]));
TextBlock tb = new TextBlock();
Canvas.SetLeft(tb, 200.0);
tb.Text = "Why is this text grey? + lots more text";
tb.FontSize = 50;
tb.Width = 300;
tb.Foreground = new SolidColorBrush(Colors.White);
tb.TextWrapping = TextWrapping.Wrap;
LayoutRoot.Children.Add(tb);
var bmp = new WriteableBitmap((int)TILE_W, (int)TILE_H);
bmp.Render(LayoutRoot, null);
bmp.Invalidate();
var isf = IsolatedStorageFile.GetUserStoreForApplication();
var filename = FILEDIREC + "/tile.jpg";
if (!isf.DirectoryExists(FILEDIREC))
{
isf.CreateDirectory(FILEDIREC);
}
using (var stream = isf.OpenFile(filename, System.IO.FileMode.OpenOrCreate))
{
bmp.SaveJpeg(stream, (int)TILE_W, (int)TILE_H, 0, 100);
}
imageURIs.Add(new Uri("isostore:" + filename, UriKind.Absolute));
//similar process for other images used by CycleTileData
//these images then added to CycleTileData in the usual way
任何帮助,解释,建议或变通办法得到degreying将不胜感激。谢谢。我试过在不同的瓷砖类型中使用图像,例如。翻转砖的正面没有问题。
我还没有看到像这样产生自定义瓷砖的问题。您可以发布您用于生成拼贴的代码(即正在创建的位图)吗? –
我有完全相同的问题....真的希望从某人回答:)。 – Niels