سلام خدمت کاربران وب سایت پروگرم 98 😉 در این مطلب کد رسم مستطیل (Rectangle) و پر کردن آن با جدول با استفاده از GeometryDrawing در #C را آماده کردم. انشاالله که این آموزش برای شما مفید باشد.
تصویر خروجی این کد:
کد رسم مستطیل (Rectangle) و پر کردن آن با جدول با استفاده از GeometryDrawing در #C :
<Window x:Class="Workspace.DockExample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Workspace" Width="640" Height="480">
<Rectangle Width="50" Height="50" Grid.Row="1" Grid.Column="1">
<Rectangle.Fill>
<DrawingBrush Viewport="0,0,10,10" ViewportUnits="Absolute" TileMode="Tile">
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="White">
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="0,0,1,1" />
</GeometryDrawing.Geometry>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Workspace" Width="640" Height="480">
<Rectangle Width="50" Height="50" Grid.Row="1" Grid.Column="1">
<Rectangle.Fill>
<DrawingBrush Viewport="0,0,10,10" ViewportUnits="Absolute" TileMode="Tile">
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="White">
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="0,0,1,1" />
</GeometryDrawing.Geometry>