Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 552
Elmo Avatar asked Oct 20 '12 13:10

Elmo


1 Answers

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.

like image 140
Kris Avatar answered Sep 22 '22 19:09

Kris