How to apply a drop shadow effect when drawing to a DrawingContext in WPF?

后端 未结 2 1678
醉话见心
醉话见心 2021-01-02 09:12

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 Dra

2条回答
  •  孤街浪徒
    2021-01-02 09:18

    If you're running on .NET Framework 3.5 SP1 or higher, you should use UIElement.Effect or Visual.VisualEffect (this one is protected so you would need to derive from it) instead, with an instance of System.Windows.Media.Effects.DropShadowEffect.

提交回复
热议问题