我正在寻找制作of的最佳pattern
方法。我想用画线显示用户画布,它将显示不同大小文档的边框,例如纸 A4。我是通过在 XAML 中使用来实现的。这是我的代码:background
canvas
DrawingBrush
<DrawingBrush x:Key="BackgroundPattern" ViewportUnits="Absolute" Stretch="None" TileMode="Tile">
<DrawingBrush.Viewport>
<Rect X="0" Y="0" Width="1089" Height="1842"/>
</DrawingBrush.Viewport>
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="Blue">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry>
<RectangleGeometry.Rect>
<Rect X="0" Y="0" Width="1089" Height="1842"/>
</RectangleGeometry.Rect>
</RectangleGeometry>
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="#FFB9B9B9">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry>
<RectangleGeometry.Rect>
<Rect X="1" Y="1" Width="1088" Height="1841"/>
</RectangleGeometry.Rect>
</RectangleGeometry>
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
我害怕我的元素的大小 -Viewport
大小是 1089x1842。还有其他方法可以制作这些吗?