Silverlight Graphics: Pixel shader effects

Source: Internet
Author: User
Tags silverlight

Use the pixel shader effect to add effects to the rendered object, such as grayscale, red eye elimination, pixel brightness, and shading. The pixel shader effect uses algorithms to change how pixels are displayed. For example, the following illustration shows a projection applied to a button.

You can use the pixel shader effect that accompanies the Silverlight runtime, or you can create it yourself.

Description

The pixel shader effects in Silverlight are rendered in a software manner. Any objects that apply effects will also be rendered in software mode. Performance is most degraded when you animate a large visual object or an effect's properties. As a result, you should use the effect with caution and adequate testing to ensure that your users get the same experience you expected.

This topic includes the following sections.

Projection and Blur

Apply multiple effects to an object

Create a custom pixel shader effect

Projection and Blur

The Silverlight runtime comes with two pixel shader effects: Dropshadoweffect and Blureffect. The examples in this section use Dropshadoweffect and demonstrate the following features:

How to use XAML to apply this effect to an object.

How to use Style to apply an effect to one or more objects.

How to use code to apply an effect to an object.

How to animate the properties of an effect.

Description

The use of Blureffect is similar to Dropshadoweffect.

The following example shows how to use XAML to apply Dropshadoweffect to a Button.

Run this example: http://go.microsoft.com/fwlink/?LinkId=139798&sref=DropShadowEffect_1

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.