如何将此VisualBrush转换为180度WPF

时间:2016-07-10 03:15:12

标签: wpf xaml

<DrawingBrush x:Key="AFT_SOUTH_HIT" Stretch="Uniform" 
                  Drawing="{Binding Drawing, Source={StaticResource AFT_NORTH_HIT}}"  >
    </DrawingBrush>

我对DrawingBrush NAMED“AFT_NORTH_HIT”有一个非常复杂的定义 我希望将180度转换为新的StaticResource“AFT_SOUTH_HIT”。每个地理方向将有一个BRUSH [N,S,E W]。我尝试将TransformGroup作为一个孩子附加,但我不知道该怎么做。

我改变了其他东西,但从未改变过DrawingBrush。在此先感谢。

 <DrawingBrush x:Key="AFT_NORTH_HIT" Stretch="Uniform">
<DrawingBrush.Drawing >
  <DrawingGroup ClipGeometry="F1 M 0,0L 30,0L 30,14.4438L 0,14.4438L 0,0">
    <DrawingGroup.Children>
      <GeometryDrawing Brush="#FF46A5AA" Geometry="F1 M 15,8.77124C 7.14633,8.77124 0.696533,4.94452 0,0.0601196L 30,0.0601196C 29.3035,4.94452 22.8537,8.77124 15,8.77124 Z " />
      <GeometryDrawing Brush="#FFFF0000" Geometry="F1 M 17.8936,0.124878L 20.1033,2.33459L 7.99411,14.4438L 5.78439,12.2341L 17.8936,0.124878 Z " />
      <GeometryDrawing Brush="#FFFF0000" Geometry="F1 M 6.47174,2.20972L 8.68146,0L 20.7906,12.1092L 18.5809,14.3189L 6.47174,2.20972 Z " />
    </DrawingGroup.Children>

    </DrawingGroup>
</DrawingBrush.Drawing>

1 个答案:

答案 0 :(得分:1)

告诉你这是否解决了你的问题:

<DrawingBrush Stretch="Uniform">
    <DrawingBrush.RelativeTransform>
        <TransformGroup>
            <RotateTransform Angle="180" CenterY="0.5" CenterX="0.5"/>
        </TransformGroup>
    </DrawingBrush.RelativeTransform>