// Get a reference to the button.button mybutton = new button();// Initialize a new DropShadowBitmapEffect that will be applIEd// to the button.DropShadowBitmapEffect myDropShadowEffect = new DropShadowBitmapEffect();// Set the color of the shadow to Black.color myShadowcolor = new color();myShadowcolor.ScA = 1;myShadowcolor.ScB = 0;myShadowcolor.ScG = 0;myShadowcolor.ScR = 0;myDropShadowEffect.color = myShadowcolor;// Set the direction of where the shadow is cast to 320 degrees.myDropShadowEffect.Direction = 320; // Set the depth of the shadow being cast.myDropShadowEffect.ShadowDepth = 25; // 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.5; // Apply the bitmap effect to the button.mybutton.BitmapEffect = myDropShadowEffect;总结
以上是内存溢出为你收集整理的c# – WPF:从代码隐藏中为一个元素添加一个dropshadow效果全部内容,希望文章能够帮你解决c# – WPF:从代码隐藏中为一个元素添加一个dropshadow效果所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)