Shadow shadow effect on Windows Phone 8.1 Runtime?
I'm looking for a way to add Drop Shadow Effect
to multiple elements in a Windows Phone 8.1 Runtime app (not Silverlight!). The main problem is that there is no official API for this. The main problem is that I need to mimic this effect not only the basic shapes (like a rectangle or lines), but also the path, like here:
Image taken from this question: path-with-broken-shadow-effect - I hope the owner doesn't mind;) Now he achieved this effect because it was done in WPF. I am working on a generic application (thus WinRT) and there is no effects extension.
I searched the website several times and found some workarounds, but they are all missing something. For example this one:
http://www.silverlightshow.net/items/Simple-Xaml-Drop-Shadows-in-Silverlight-2.aspx <- I can't work with Canvas
, the content should be Grid
.
Do you know how I can achieve satisfactory results when faking shadow effect on Windows Phone 8.1 Runtime?
source to share
Apply RenderTransform
to the shadow shape. Set the scale to make it larger:
<Grid Style="{StaticResource LayoutRootStyle}" Background="#FF803535" >
<Rectangle Width="100" Height="100" Opacity="0.3" RenderTransformOrigin="0,0" StrokeThickness="16" StrokeDashCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round" StrokeStartLineCap="Round" Stroke="Black" >
<Rectangle.RenderTransform>
<CompositeTransform ScaleX="1.07" ScaleY="1.07" />
</Rectangle.RenderTransform>
</Rectangle>
<Rectangle Width="100" Height="100" Fill="Blue"></Rectangle>
</Grid>
source to share