I'm drawing into a DrawingContext
, and I'd like to apply a drop shadow effect to part of the drawing. At the moment I create the relevant parts in a DrawingGroup
and apply a BitmapEffect
, but this has no effect:
var layer = new DrawingGroup();
using (var lcontext = layer.Open())
{
// draw stuff in lcontext
}
layer.BitmapEffect = new DropShadowBitmapEffect { Color = Colors.Black, ShadowDepth = 3, Opacity = 0.5 };
context.DrawDrawing(layer);
This draws everything inside the layer
correctly, but without the drop shadow effect.
What am I doing wrong / how else might I apply a drop shadow to a bunch of primitives in a DrawingContext?
DrawingGroup
is rendered directly into aRenderTargetBitmap
. Odd how I have to use UI elements for pure rendering, eh?... – Destruction