Text shadow
Thanks
Thanks
Here's a start:
<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <!-- The object to reflect. --> <Rectangle Height="1" Fill="Gray" HorizontalAlignment="Stretch" /> <!-- The object to contain the reflection.--> <!-- Creates the reflection. --> <!-- Flip the reflection. --> </Canvas>
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel Margin="50">
<RichTextBox Name="rtb" Width="400">
<FlowDocument>
<Paragraph> Some Text </Paragraph>
</FlowDocument>
</RichTextBox>
<Rectangle
Height="{Binding Path=ActualHeight, ElementName=rtb}"
Width="{Binding Path=ActualWidth, ElementName=rtb}">
<Rectangle.Fill>
<VisualBrush
Opacity="0.75" Stretch="None"
Visual="{Binding ElementName=rtb}">
<VisualBrush.RelativeTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="-1" />
<TranslateTransform Y="1" />
<SkewTransform AngleX="3" />
</TransformGroup>
</VisualBrush.RelativeTransform>
</VisualBrush>
</Rectangle.Fill>
</Rectangle>
</StackPanel>
Hi Cornel
Do you mean you want to create the text shadow but not text box shadow without using BitmapEffects? If so, you can create two text to simulate the shadow. For example:
<RichTextBox Name="rtb" Width="400">
<FlowDocument> <BlockUIContainer> <Grid> <TextBlock Foreground="Black" Text="Shadow Text"> <TextBlock.RenderTransform> <TranslateTransform X="3" Y="3"/> </TextBlock.RenderTransform> </TextBlock><TextBlock Foreground="Coral" Text="Shadow Text"/> </Grid> </BlockUIContainer> </FlowDocument> </RichTextBox>
Best Regards
Wei Zhou