【问题标题】:How to fill a Win10 XAML Polygon with tiles?如何用瓷砖填充 Win10 XAML 多边形?
【发布时间】:2016-02-23 10:09:20
【问题描述】:

我正在尝试使 XAML 多边形充满已转换的纹理。该代码在 WPF 中运行良好,但在 Windows 10 应用程序中似乎没有 TileMode 属性。

 <Polygon Points="300,200 400,125 400,275" Stroke="Purple" StrokeThickness="2">
        <Polygon.Fill>
            <ImageBrush TileMode="Tile" ImageSource="Assets/StoreLogo.png">
                <ImageBrush.RelativeTransform>
                    <TransformGroup>
                        <ScaleTransform CenterY="0.5" CenterX="0.5" ScaleX="0.2" ScaleY="0.2"/>
                        <SkewTransform CenterY="0.5" CenterX="0.5"/>
                        <RotateTransform CenterY="0.5" CenterX="0.5" Angle="61.928"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </ImageBrush.RelativeTransform>
            </ImageBrush>
        </Polygon.Fill>
    </Polygon> 

【问题讨论】:

标签: c# wpf xaml win-universal-app windows-10-universal


【解决方案1】:

您可以使用Win2D 库进行平铺。他们也有sample code;在“效果”(EffectsSample.xaml.cs) 下有一个平铺示例。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-05-28
    • 2021-04-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-04
    • 1970-01-01
    相关资源
    最近更新 更多