据此- 您可以在WP 上使用 ImageBrush。(虽然我没有试过这个)
<TextBlock FontFamily="Verdana" FontSize="72">
<TextBlock.Foreground>
<ImageBrush ImageSource="forest.jpg"/>
</TextBlock.Foreground>
</TextBlock>
编辑:
这是我制定的一种解决方案 - 它有一些缺点,但效果很好,并且可以让您很好地使用许多画笔:
Canvas canvasToBeBrush = new Canvas();
canvasToBeBrush.Width = 300;
canvasToBeBrush.Height = 300;
Rectangle firstBrush = new Rectangle();
firstBrush.Width = 200;
firstBrush.Height = 200;
firstBrush.Fill = new RadialGradientBrush(Colors.Blue, Colors.Brown);
Rectangle secondBrush = new Rectangle();
secondBrush.Width = 200;
secondBrush.Height = 200;
secondBrush.Opacity = 0.5;
secondBrush.Fill = new SolidColorBrush(Colors.Orange);
canvasToBeBrush.Children.Add(firstBrush);
canvasToBeBrush.Children.Add(secondBrush);
WriteableBitmap bitmapToBrush = new WriteableBitmap(canvasToBeBrush, null);
ImageBrush myBrush = new ImageBrush();
myBrush.ImageSource = bitmapToBrush;
LayoutRoot.Background = myBrush;