0

I need an "outer glow" effect in my TextBlock, I saw OuterGlowBitmapEffect but it does not work in WPF4.0 anymore. DropshadowEffect and BlurEffect just don't work exactly like OuterGlowBitmapEffect. I want to ask whether there is a way to use that obsolete OuterGlowBitmapEffect or are there any user-made alternatives, libraries that can provide the glow effect?

  • Have you tried this? https://stackoverflow.com/questions/17520901/button-styling-outerglowbitmapeffect-dropshadoweffect – Kevin Cook Jul 19 '19 at 15:11

1 Answers1

1

Sometimes the effect is too light, there are ways to make it darker / more bold.

One way is to apply the effect twice, but since you only can apply an effect once on a control, you just have to work a little.

     <Border>
        <Border.Effect>
            <DropShadowEffect Color="Black" ShadowDepth="0" BlurRadius="10" RenderingBias="Quality"></DropShadowEffect>
        </Border.Effect>
        <TextBlock Text="OuterGlowBitmapEffect" FontSize="28" Foreground="White">
            <TextBlock.Effect>
                <DropShadowEffect Color="Black" ShadowDepth="0" BlurRadius="10" RenderingBias="Quality"></DropShadowEffect>
            </TextBlock.Effect>
        </TextBlock>
    </Border>

In this case I use a border to apply the effect a second time on the TextBlock. this changes to BlurRadius to be 2x darker. You can also play with this an use multiple colors, I.E. one blur effect could be a little bigger (15?) and green, and the main one be black, for a Halloween feel.

You could also use a grid, and just copy the TextBlock with the DropShadowEffect into it a couple of times, till you get the darkness you like.

    <Grid>
        <TextBlock Text="OuterGlowBitmapEffect" FontSize="28" Foreground="White">
            <TextBlock.Effect>
                <DropShadowEffect Color="Black" ShadowDepth="0" BlurRadius="10" RenderingBias="Quality"></DropShadowEffect>
            </TextBlock.Effect>
        </TextBlock>
        <TextBlock Text="OuterGlowBitmapEffect" FontSize="28" Foreground="White">
            <TextBlock.Effect>
                <DropShadowEffect Color="Black" ShadowDepth="0" BlurRadius="10" RenderingBias="Quality"></DropShadowEffect>
            </TextBlock.Effect>
        </TextBlock>
        <TextBlock Text="OuterGlowBitmapEffect" FontSize="28" Foreground="White">
            <TextBlock.Effect>
                <DropShadowEffect Color="Black" ShadowDepth="0" BlurRadius="10" RenderingBias="Quality"></DropShadowEffect>
            </TextBlock.Effect>
        </TextBlock>
        <TextBlock Text="OuterGlowBitmapEffect" FontSize="28" Foreground="White">
            <TextBlock.Effect>
                <DropShadowEffect Color="Black" ShadowDepth="0" BlurRadius="10" RenderingBias="Quality"></DropShadowEffect>
            </TextBlock.Effect>
        </TextBlock>
    </Grid>
Kevin Cook
  • 1,922
  • 1
  • 15
  • 16