共用方式為


WPF Bitmap Effects

Bitmap effects enable designers and developers to apply visual effects to rendered Windows Presentation Foundation (WPF) content. For example, bitmap effects allow you to easily apply a DropShadowBitmapEffect effect or a blur effect to an image or a button. The unmanaged APIs provide an extensible framework for independent hardware vendors (IHVs) to develop custom effects to use in WPF applications.

Bitmap effects (IMILBitmapEffect object) are simple pixel processing operations. A bitmap effect takes a IWICBitmapSource Interface as an input and produces a new IWICBitmapSource Interface after applying the effect, such as a blur or drop shadow.

Native Bitmap Effects

There are 5 built in bitmap effects available in WPF.

Effect Description Effect CLSID
Blur Simulates looking at an object through an out-of-focus lens. CLSID_MILBitmapEffectBlur
DropShadow Applies a shadow behind a visual object at a slight offset. CLSID_MILBitmapEffectDropShadow
OuterGlow Creates a halo of color around objects or areas of color. CLSID_MILBitmapEffectOuterGlow
Bevel Creates a bevel which raises the surface of the image according to a specified curve. CLSID_MILBitmapEffectBevel
Emboss Creates a bump mapping of the visual object to give the impression of depth and texture from an artificial light source. CLSID_MILBitmapEffectEmboss

 

Custom BitmapEffects

Custom effects are created by implemented the unmanaged APIs to create an effect library that can be used in a managed WPF application.

For an example of a custom bitmap effect, see Custom RGBFilter Effect in WPF.

Custom RGBFilter Effect in WPF

IMILBitmapEffect