Elmo
Elmo

Reputation: 6471

Outer Glow Effect for TextBlock in WinRT

WinRT doesn't have OuterGlowBitmapEffect. So, is there any way to display the outer glow effect for a TextBlock in WinRT?

Upvotes: 5

Views: 2762

Answers (1)

Kris
Kris

Reputation: 7170

There is not a good way to apply effects to XAML content, WinRT also currently lacks a way to render XAML elements to a bitmap so you are mainly left with methods where you don't use XAML.

Make sure the glow is necessary and you have reviewed the guidelines for Windows 8 apps. If your sure you need it here are a few suggestions:

  • For simple cases you may be able to use gradients or duplicated geometry to get a glow affect.

  • Bundle graphics with the glow already applied with your app, this obviously wouldn't work for completely dynamic shapes but you could do it for text similar to my answer here.

  • Use Direct2D instead of XAML and use Direct2D effects (SharpDX offers bindings for Direct2D)

  • If you need to apply a glow to a bitmap you could use a WriteableBitmap and apply the glow yourself. (WriteableBitmapEX could be useful)

  • Use HTML and CSS instead of XAML, possibly hosted in a WebView or for the whole app.

Upvotes: 5

Related Questions