wpf VisualBrush 的使用,可创建重复图像

VisualBrush 类(msdn)

 <Grid.Background>
                    <VisualBrush TileMode="Tile" Viewport="0,0,1,1">
                        <VisualBrush.Visual>
                            <Button Width="20" Height="20" Background="Red" BorderBrush="Orange" BorderThickness="2"></Button>
                        </VisualBrush.Visual>
                    </VisualBrush>
  </Grid.Background>

可设置ViewPort值控制图像重复方式

猜你喜欢

转载自www.cnblogs.com/maoyuanwai/p/8986865.html