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

后端 未结 2 1694
醉话见心
醉话见心 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:19

    BitmapEffect is an old property (they used CPU-rendered effects) from pre .NET 3.5. The property has no effect in 4.0.

    In 4.0 you should use Effect property, which uses Pixel Shaders.

    DrawingGroup however doesn't appear to have an effect property - it sounds like you might need to set the effect on the parent UI element instead.

提交回复
热议问题