Welcome to Windows Presentation Foundation (WPF)
Top Tasks :

WPF Team Bloggers

Browse by Tags

All Tags » Effects   (RSS)

  • A simple Effect sample project and ClickOnce application

    The previous post in this series began to talk about writing custom Effects for WPF. We looked specifically at ColorComplementEffect, an effect with no parameters. In upcoming posts, we'll get into the details of multi-parameter effects and other specifics. But in the meantime, I thought it would be useful to post a sample VS project and a ClickOnce application from that project for folks just itching to get going. The app looks like this: It's nothing fancy, mostly XAML and, in fact, the way the code and structure and UI are constructed are not conducive to hosting all effects now and forever (a more sophisticated hoster of effects would make a lot more use of metadata and reflection to allow arbitrary effects to be applied and parameters to be tweaked). However, this definitely does the job in terms of showing how Effects are used and written. There are two projects in the solution -- one is a MyEffects library, and the other just an EffectTest application that uses Effects from MyEffects. Read More...
  • Writing custom GPU-based Effects for WPF

    The last few posts in this series on Effects have focused on the perspective of those using Effects. These Effects have to come into being somehow, and that's where we turn to now. In this post we showed how to apply a ColorComplementEffect to go from this to this: ColorComplementEffect, which very much looks like a photographic negative, is just about the simplest Effect one can imagine. Conceptually, all it does is take the RGB color components and create a new color with each component subtracted from 1.0. Let's first show what it takes to write it and add it to your app, then we'll expand and generalize from there in the next post. Creating the HLSL for color complement Here's some simple HLSL for doing the color complement. Note that this series is not in the least intended to be an HLSL tutorial. There are a bunch out on the Net, and there is also a Programmer's Guide and Reference Guide on MSDN that can be a good place to start. Also starting from existing examples (like those included Read More...
  • More details on how Effects work

    The last couple posts in this series have dug into features and example usage of Effects in WPF. Let’s go into some other aspects of the feature that are important to understand. Software Rendering When we discuss Effects, we typically talk about them being GPU-accelerated. This is typically the case. However, there are three important situations where the Effects cannot be GPU-accelerated: When the graphics card being run on does not support PixelShader 2.0 or above. This is becoming more and more rare, but is definitely still out there. When the WPF application is being remoted over Remote Desktop or Terminal Server or some other kind of mirror driver. When the WPF application is in a mode where software rendering is required – such as rendering to a RenderTargetBitmap, or printing. In all of these cases, WPF will render Effects via software. What does that mean? As mentioned in an earlier post, Effects are written using HLSL for programming the GPU. WPF incorporates a “ JIT ter” (Just-in-Time Read More...
  • Using Effects in WPF (Part 2)

    My previous post on Effects (part of this series ) gives a simple example of instantiating an parameterless Effect (it just takes the complement of a color) through XAML. Here we discuss more about the use of Effects. First, lest you think that Effects are somehow a XAML-only feature, let’s write some code to use Effects. Recall that the invocation of the Effect through XAML looked like this: < Grid > < Grid.Effect > < eff : ColorComplementEffect /> </ Grid.Effect > < Image ... /> < Button ... / > < TextBox ... / > </ Grid > In code, presuming I already have the Grid and it’s called “myGrid”, we’d just do the following: myGrid.Effect = new MyEffects. ColorComplementEffect(); Like everything else in WPF, Effects are readily creatable and manipulable through code. Given that, most of the below will focus on usage through XAML just because it’s the most succinct way of expressing the usage. The ColorComplementEffect is very limited in what it Read More...
  • GPU-accelerated custom effects for WPF

    With WPF 3.5 SP1 on the horizon (and the Beta available now ), I plan to discuss some of the new graphics features that are coming into WPF in this release. There are a number of great new additions as well as improvements on existing features, but I will say that the one that I’m the most excited about is GPU-accelerated custom effects. I’m going to go into a good amount of depth in a series of upcoming blog posts, so I’ll dedicate this one to talking about the basics of what we’re offering and the motivation behind the feature. One of the hallmarks of WPF is the ability to mix and match media types, to compose visual elements, and to give the developer a substantial amount of freedom in the way they construct the interfaces for their applications. However, they are typically restricted to using the building blocks that WPF provides, such as rectangles, text, video, paths, gradients, images, etc. As rich as that set of primitives is, it is still a fixed set of primitives that only has Read More...
  • A Series on GPU-based Effects for WPF

    GPU-based Effects are a hot new feature in WPF for .NET 3.5 SP1. I'm going to be blogging a series of articles with progressively more detailed information in them, and am using this post as a place to store a table of contents of these posts. Here's what's out there so far: GPU-accelerated custom Effects for WPF Using Effects in WPF (Part 2) More details on how Effects work Writing custom GPU-based Effects for WPF Read More...
  • First Sample BitmapEffect

    We've announced a while ago that the BitmapEffects pipeline within WinFx (particularly in Windows Presentation Read More...
  • Official MSDN Documentation (for WIC and BitmapEffects)

    Some folks have asked where the official documentation is for WindowsCodecs. It's there in MSDN, but Read More...

Copyright © 2006 Microsoft Corporation. All Rights Reserved. | Terms of Use | Privacy Statement | Contact Us