سلام خدمت کاربران وب سایت پروگرم 98 😉 در این مطلب کد Grid با مستطیل و GeometryDrawing با wpf و سی شارپ #C را آماده کردم. انشاالله که این کد سی شارپ براتون مفید باشد.
تصویر خروجی این کد:
کد Grid با مستطیل و GeometryDrawing با wpf و سی شارپ #C :
<Window x:Class="WPFBrushes.ColorAndAlpha"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Alpha Channel" Height="300" Width="300">
<Grid VerticalAlignment="Center" HorizontalAlignment="Center">
<Rectangle Height="200" Width="200">
<Rectangle.Fill>
<DrawingBrush Viewport="0,0,10,10" ViewportUnits="Absolute" TileMode="Tile">
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="Black">
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="0,0,10,10" />
</GeometryDrawing.Geometry>
</GeometryDrawing>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Alpha Channel" Height="300" Width="300">
<Grid VerticalAlignment="Center" HorizontalAlignment="Center">
<Rectangle Height="200" Width="200">
<Rectangle.Fill>
<DrawingBrush Viewport="0,0,10,10" ViewportUnits="Absolute" TileMode="Tile">
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="Black">
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="0,0,10,10" />
</GeometryDrawing.Geometry>
</GeometryDrawing>