对DrawingVisual的模糊效果的替代方法 [英] Alternative of blur effect on DrawingVisual

查看:86
本文介绍了对DrawingVisual的模糊效果的替代方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想给 DrawingVisual 赋予模糊效果。我可以使用 BitmapEffect 这样的属性来做到这一点:

I want to give a blur effect to my DrawingVisual. I can do this using BitmapEffect properties like:

DrawingVisual drawingVisual = new DrawingVisual();
DrawingContext drawingContext = drawingVisual.RenderOpen();
var effect = new System.Windows.Media.Effects.BlurBitmapEffect();
effect.Radius = 10;
drawingVisual.BitmapEffect = effect;

但是编译器会警告我,位图效果属性已过时。

But the compiler give me a warning that Bitmap effect properties is obsolete.

我还能使用什么其他方法来达到 DrawingVisual 的效果?

What other alternative I can use to achive the effect on DrawingVisual?

推荐答案

DrawingVisual的Effect属性在3.5SP1中不受支持,但是还有另一种方法可以将着色器效果应用于视觉效果。 此处是该示例如何将着色器效果应用于DrawingVisual

Effect property of DrawingVisual in not support in 3.5SP1 but there is another way to achieve this to apply shader effect to visual. Here is the example how we can apply shader effect to DrawingVisual

这篇关于对DrawingVisual的模糊效果的替代方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆