本文介绍了WPF模糊内容方面变得透明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直有模糊的问题,对内容(网格,堆叠面板等)应用模糊对父背景(或图像)变得透明,我需要做什么来阻止这样的事情?
I have long problem with blur, applying blur to content(grid, stackpanel, etc) sides become transparent to parent background(or image), what I need to do prevent from such thing?
示例以显示我的问题:
<Window x:Class="sampleWPF.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800"
Background="Green">
<Grid Background="Yellow">
<Grid.Effect>
<BlurEffect Radius="50"/>
</Grid.Effect>
</Grid>
</Window>
正如你可以看到窗口有绿色背景,网格有黄色背景,所以模糊网格有绿色边,我需要做什么来防止这样的东西?
$
As you can see window has green background, and grid has yellow background, so blurred grid has green sides, what I need todo to prevent from such thing?
推荐答案
这篇关于WPF模糊内容方面变得透明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!