The visual effects of setting elements in WPF are primarily used in the Blureffect class and the Dropshadoweffect class. (currently only two, haha)
1.BlurEffect class
Namespaces:
System.Windows.Media.Effects. Blureffect
A bitmap effect that blurs the target texture.
Assembly: PresentationCore (in PresentationCore.dll)
Xmlns:http://schemas.microsoft.com/winfx/2006/xaml/presentation for XAML, http://schemas.microsoft.com/netfx/2007 /xaml/presentation
Sample XAML Code:
1<StackPanel>2 3<image source="C:\Users\ every day happy \pictures\501d2024bb239.jpg"Width=" Max"margin="Ten">4<Image.Effect>5<blureffect radius="1"></BlurEffect>6</Image.Effect>7</Image>8 9<image source="C:\Users\ every day happy \pictures\501d2024bb239.jpg"Width=" Max"margin="Ten">Ten<Image.Effect> One<blureffect radius="5"></BlurEffect> A</Image.Effect> -</Image> - the<image source="C:\Users\ every day happy \pictures\501d2024bb239.jpg"Width=" Max"margin="Ten"> -<Image.Effect> -<blureffect radius="Ten"></BlurEffect> -</Image.Effect> +</Image> -</StackPanel>
Where the Blureffect.radius property is used to
Gets or sets a value that indicates the radius of the blur effect curve.
The effect is as follows:
2.ShadowEffect class
A bitmap effect that is used to draw projections around the target texture.
Namespace: System.Windows.Media.Effects. Dropshadoweffect
Assembly: PresentationCore (in PresentationCore.dll)
Xmlns:http://schemas.microsoft.com/winfx/2006/xaml/presentation for XAML, http://schemas.microsoft.com/netfx/2007 /xaml/presentation
Sample XAML Code
1 <textblock fontsize= "margin="5">2 <TextBlock.Effect>3 <DropShadowEffect>4 </ Dropshadoweffect>5 </TextBlock.Effect>6 <textblock.text>basic dropshadow</textblock.text>7 </TextBlock>
Default Effect Basic DropShadow
1 <dropshadoweffect color="Pink"></DropShadowEffect>
Set the shadow color to Pink Pink DropShadow
1 <dropshadoweffect blurradius="> </DropShadowEffect>
Set the shadow radius, the larger the shadow the more blurred blurred dropshadow
1 <dropshadoweffect shadowdepth="></DropShadowEffect>"
Set the distance between the shadow and the target as far as possible shadowdepth
1 <dropshadoweffect opacity=". 5"></DropShadowEffect>
Set Shadow Transparency Opacity
1 <dropshadoweffect direction=">"
Set the direction of the shadow counter-clockwise to calculate 0 means just below 90 means the top 180 means on the left Direction
Operating effect:
WPF element Visualizations