5

I tried to google it out, but is there any sample Shader effect which I could use to produce an outlined FormattedText. I was able to get the outline by using BuildGeometry(), but the performance is very poor!

outlined Text

PS: Since I'm new to this and still learning, it would be helpful if anyone can suggest whether it would be even possible or not.

Trainee4Life
  • 2,203
  • 2
  • 22
  • 38

1 Answers1

3

Here's an easy option I whipped up, but not sure if it's exactly what you want. Just use an OuterGlowBitmapEffect.

You can paste my example straight into Kaxaml to see what it looks like:

<Page
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <Grid Background="Black">  
    <TextBlock FontFamily="Arial" FontSize="36" FontWeight="Bold" Text="Text" Foreground="White">
      <TextBlock.BitmapEffect>
        <OuterGlowBitmapEffect GlowColor="Orange" GlowSize="6" />
      </TextBlock.BitmapEffect>
    </TextBlock>
  </Grid>
</Page>

alt text

Dave
  • 14,618
  • 13
  • 91
  • 145
  • 2
    Some users report this DOES NOT work on .NET 4 because BitmapEffect was deprecated.... it keeps on working for me tho :p – Machinarius Dec 10 '10 at 14:24
  • Thanks for giving me the heads up. I personally love the effect but was using it on .NET 3.5. I just upgraded to .NET 4.0 last week. :) I hope it's been replaced by something just as easy! – Dave Dec 10 '10 at 14:26
  • 1
    GlowEffect not equivalent to Outline. What I need is an Outline, without using BuildGeometry(). – Trainee4Life Dec 10 '10 at 20:08