1 つのブラシで複数のブラシを使用することはできGeometryDrawing
ますか? さまざまなブラシで描画したいジオメトリがいくつかありますが、それぞれに対して個別に宣言する必要があるのはかなり冗長GeometryDrawing
です。次のことをより簡潔に表現する方法を探しています。
<DrawingImage x:Key="SomeDrawingImage">
<DrawingImage.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="{StaticResource SomeGradient}">
<GeometryDrawing.Geometry>
<PathGeometry Figures="{StaticResource SomeFigures}">
<PathGeometry.Transform>
<TransformGroup>
<TranslateTransform X="50" />
</TransformGroup>
</PathGeometry.Transform>
</PathGeometry>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="{StaticResource SomeOtherGradient}">
<GeometryDrawing.Geometry>
<PathGeometry Figures="{StaticResource SomeOtherFigures}">
<PathGeometry.Transform>
<TransformGroup>
<TranslateTransform X="100" />
</TransformGroup>
</PathGeometry.Transform>
</PathGeometry>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>