【发布时间】:2011-01-22 00:34:00
【问题描述】:
谁能告诉我为什么 /no/ outerglow 效果在我的 WPF 窗口上起作用?下面是代码示例:
<Window x:Class="SocialShock_WPF_Client.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525"
AllowsTransparency="True"
WindowStyle='None'
Background="Transparent"
Loaded="Window_Loaded">
<Grid>
<Rectangle Margin="12" Name="rectangle1" Fill="#FFB75050">
<Rectangle.BitmapEffect>
<OuterGlowBitmapEffect GlowColor="Black" GlowSize="20" />
</Rectangle.BitmapEffect>
</Rectangle>
</Grid>
</Window>
以及生成的图像:
http://img408.imageshack.us/img408/6213/1c1761f31ce6408d948e266.png
边缘没有发光。 不仅发光不会出现在矩形上,而且我添加到窗口的任何其他控件也不能接受发光。
编辑: .Net 4.0
【问题讨论】:
-
您使用的是哪个版本的 .NET 框架? BitmapEffects 自 .NET 4.0 起已弃用
-
BitmapEffects 在 .net 4 中不起作用?那么我将如何在 .net 4 中做到这一点?