我正在使用 C# 和 WPF 构建我的项目。在我的应用程序中,我将一个小尺寸的图像(25x25)作为我的应用背景。我在网上找到了一些示例,当我尝试它时,我的应用程序背景看起来像是图像A。但我希望我的背景看起来像是图像B。有人知道如何让它像图像B吗?
我的 WPF 代码片段:
<Grid>
<Grid.Background>
<VisualBrush TileMode="Tile" Viewport="0.8,0.8,0.1,0.1" AlignmentX="Left" AlignmentY="Top">
<VisualBrush.Visual>
<Image Source="/Wpf_Customer;component/bg.jpg"></Image>
</VisualBrush.Visual>
</VisualBrush>
</Grid.Background>
<RadioButton Content="Graph" Name="dsad" FontSize="15" ></RadioButton>
</Grid>
图片A:
图片B:
编辑后:
图片C:
<ImageBrush AlignmentY="Top" ImageSource="/Resources/Images/pattern-notebook.png" Stretch="None" TileMode="FlipY" Viewport="0,0,10,10" ViewportUnits="Absolute" />
- psulek