WPF element Visualizations

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.