Create WindowsFormHost reflection in wpf

I am very new to WPF and I am a bit stuck.

I am trying to create a demo program that displays several built-in win form applications. I would like to add a reflection of the form, but most of the existing tutorials that I saw for image reflections do not work.

If someone can point me in the right direction, I would really appreciate it.

Here is the corresponding XAML - the form control is added to the toolbar embedFormdynamically.

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Border Name="inkBorder" Grid.Row="0" VerticalAlignment="Bottom" Margin="20"
            Width="400" Height="500" CornerRadius="5" BorderThickness="4">
                <Border.BorderBrush>
                    <LinearGradientBrush SpreadMethod="Reflect" StartPoint="0,0" EndPoint="0.5,0.5">
                        <LinearGradientBrush.GradientStops>
                            <GradientStop Color="Gray" Offset="0" />
                            <GradientStop Color="#eeeeee" Offset="1" />
                        </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                </Border.BorderBrush>
            <StackPanel Name="EmbedForm" Height="100" Width="400" ></StackPanel>
        </Border>

            <Rectangle Grid.Row="1" VerticalAlignment="Top"
               Width="{Binding ElementName=inkBorder,Path=ActualWidth}"
               Height="{Binding ElementName=inkBorder,Path=ActualHeight}">

                <Rectangle.OpacityMask>
                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                        <LinearGradientBrush.GradientStops>
                            <GradientStop Offset="0.0" Color="#66000000" />
                            <GradientStop Offset="1.0" Color="#00000000" />
                        </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                </Rectangle.OpacityMask>
                <Rectangle.Fill>
                    <VisualBrush 
          Visual="{Binding ElementName=inkBorder}">
                        <VisualBrush.RelativeTransform>
                            <TransformGroup>
                                <ScaleTransform ScaleX="1" ScaleY="-1" />
                                <TranslateTransform Y="1" />
                            </TransformGroup>
                        </VisualBrush.RelativeTransform>
                    </VisualBrush>
                </Rectangle.Fill>
            </Rectangle>
        </Grid>

To clarify the question a bit ...

Basically, I am looking for a way to apply any visual transformations to controls, such as WindowsFormHostand WebBrowser.

, , , - , , .

+3
1

WindowsFormsHost WebBrowser , WPF, GDI +.

, , , - GDI +... , ...

+3

Source: https://habr.com/ru/post/1727919/


All Articles