سلام بر تمامی برنامه نویسان #C 😉 در این مطلب کد شبیه سازی بازتاب تصویر با استفاده از VisualBrush در #C را آماده کردم. انشاالله که این آموزش برای شما مفید باشد.
تصویر خروجی این کد:
کد شبیه سازی بازتاب تصویر با استفاده از VisualBrush در #C :
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Grid x:Name="mainUI" IsSharedSizeScope="True" Background=''"Auto" />
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<GroupBox Header="Position" Grid.Row="0" Margin="4">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="Left" />
<ColumnDefinition Width="80" />
</Grid.ColumnDefinitions>
<TextBlock Text="X: " />
<TextBox Grid.Column="1" />
</Grid>
</GroupBox>
</Grid>
<Rectangle Grid.Row="1">
<Rectangle.LayoutTransform>
<ScaleTransform ScaleY="-1" />
</Rectangle.LayoutTransform>
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Grid x:Name="mainUI" IsSharedSizeScope="True" Background=''"Auto" />
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<GroupBox Header="Position" Grid.Row="0" Margin="4">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="Left" />
<ColumnDefinition Width="80" />
</Grid.ColumnDefinitions>
<TextBlock Text="X: " />
<TextBox Grid.Column="1" />
</Grid>
</GroupBox>
</Grid>
<Rectangle Grid.Row="1">
<Rectangle.LayoutTransform>
<ScaleTransform ScaleY="-1" />
</Rectangle.LayoutTransform>