Hello. Suppose there is a transparent control (or the entire window). Through it, everything under it shines through. But is there any way to set effects for transparency? For example, blur. Or increase. Or tell me how to get bitmap from the content under?
1 answer
The simplest of WPF effect classes is BlurEffect . It blurs the contents of the element, as if looking at it through a defocused lens. The degree of blurring is increased by increasing the value of the Radius property (which defaults to 5).
<Button Background="Transparent" Content="Hello"> <Button.Effect> <BlurEffect Radius="5"/> </Button.Effect> </Button> To make the content of the control not blur, you can try to do this:
<Grid> <Border Padding="20" BorderBrush="Blue" BorderThickness="3" CornerRadius="10"> <Border.Effect> <BlurEffect Radius="5"/> </Border.Effect> </Border> <TextBlock Text="Some text inside a Border" VerticalAlignment="Center" HorizontalAlignment="Center"/> </Grid> - And the content of the buttons it also blur? - iRumba
- @iRumba, yes, the content will blur too. - Lightness
- And it is necessary, that would not blur ... - MaximK
- @MaximK, updated the answer, try. - Lightness
- Come for now. But I don’t like something in this way ... Until I understand what. Perhaps more will be seen. - iRumba
|