Euclidez

Hello, I've a problem with a reflection effect and may be you can help with it.

I'm trying the reflect effect. The problem is when I resize my window to small value, the reflect (scroll bars, etc) begin to grow, and the effect is not a reflect. I think the problem is in the Height="400" of the Rectangle that make the reflect effect, because this value change and may be I've to databind that value. Any idea of what can I do to solve this

This is the code. Thanks a lot people !!!

<Window

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

xml:lang="en-US"

x:Class="UntitledProject8.Window1"

x:Name="Window"

Title="Window"

Width="640" Height="480">

<Grid x:Name="LayoutRoot">

<Grid x:Name="ImageGrid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="10,10,10,10">

<Grid.RowDefinitions>

<RowDefinition Height="0.80*"/>

<RowDefinition Height="0.20*"/>

</Grid.RowDefinitions>

<Border x:Name="borderImg" Margin="0,0,0,0" Width="Auto" Height="Auto" Background="#FFFFFFFF" BorderBrush="{x:Null}" Padding="4,4,4,4" TextElement.Foreground="{x:Null}">

<ScrollViewer Width="Auto" Height="Auto" Background="#FFF0F0F0" HorizontalScrollBarVisibility="Visible">

<Image Source="c:\\1_1.jpg"/>

</ScrollViewer>

</Border>

<Rectangle Width="Auto" Height="400" Grid.Row="1">

<Rectangle.Fill>

<VisualBrush Visual="{Binding ElementName=borderImg}">

<VisualBrush.RelativeTransform>

<ScaleTransform ScaleY="-1" CenterY="0.5"/>

</VisualBrush.RelativeTransform>

</VisualBrush>

</Rectangle.Fill>

<Rectangle.OpacityMask>

<LinearGradientBrush EndPoint="0.5,0.703" StartPoint="0.5,-0.218">

<GradientStop Color="#4C000000" Offset="0"/>

<GradientStop Color="#00FFFFFF" Offset="1"/>

</LinearGradientBrush>

</Rectangle.OpacityMask>

</Rectangle>

</Grid>

</Grid>

</Window>



Re: Windows Presentation Foundation (WPF) Reflection effect scale problem ...

Euclidez

Any idea of what to do



Re: Windows Presentation Foundation (WPF) Reflection effect scale problem ...

Munkii

You have the Image in a ScrollViewer, do want the Image to be scrollable Removing the ScrollViewer removes the scrollbar problem but perhaps you want it to be scrollable

Pat





Re: Windows Presentation Foundation (WPF) Reflection effect scale problem ...

Euclidez

I want the image to be scrollable. But the problem seems to be about the rectangle size.

Any idea

Thanks a lot !!