1

DropShadowBitmapEffectUserControlに適用するコードがいくつかあります。

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
4

1 に答える 1

2
DropShadowEffect myDropShadowEffect = new DropShadowEffect();

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 effect to the Button.
this.Effect = myDropShadowEffect;

何が同等かわかりませんSoftness...BlurRadius値を調整してみてください

于 2012-05-16T12:19:06.540 に答える