是否可以在单个中使用多个画笔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>