我有一些代码可以应用于DropShadowBitmapEffect
UserControl。
Visual Studio 表示this.BitmapEffect
已弃用,我们必须使用Effects
.
那应该怎么做呢?
DropShadowBitmapEffect myDropShadowEffect = new DropShadowBitmapEffect();
myDropShadowEffect.Color = GetShadowColorValue();
myDropShadowEffect.Direction = 250;
// Set the depth of the shadow being cast.
myDropShadowEffect.ShadowDepth = 0;
// Set the shadow softness to the maximum (range of 0-1).
myDropShadowEffect.Softness = 1;
// Set the shadow opacity to half opaque or in other words - half transparent.
// The range is 0-1.
myDropShadowEffect.Opacity = 0.7;
// Apply the bitmap effect to the Button.
this.BitmapEffect = myDropShadowEffect; // BitmapEffect is deprecated