BitmapEffect BitmapEffect BitmapEffect BitmapEffect Class

定义

注意:此 API 现已过时。Note: This API is now obsolete. 未过时的替代项为 EffectThe non-obsolete alternative is Effect.

定义位图效果。Defines a bitmap effect. 派生类将定义可应用到 Visual 对象(如 ButtonImage)的效果。Derived classes define effects that can be applied to a Visual object, such as a Button or an Image.

public ref class BitmapEffect abstract : System::Windows::Media::Animation::Animatable
public abstract class BitmapEffect : System.Windows.Media.Animation.Animatable
type BitmapEffect = class
    inherit Animatable
Public MustInherit Class BitmapEffect
Inherits Animatable
继承
派生

注解

备注

WPFWPF 位图效果是呈现的软件。bitmap effects are software rendered. 应用效果的任何对象也都将以软件形式呈现。Any object that applies an effect will also be rendered in software. 不应将位图效果应用到大型视觉对象或动画,,因为这可能会降低性能。Bitmap effects should not be applied to large visuals or animations, because this can degrade performance.

注意

位图效果不支持部分信任执行。Bitmap effects do not support partial trust execution. 应用程序必须具有完全信任权限才能使用位图效果。An application must have full trust permissions to use bitmap effects.

缩放转换将应用到视觉对象之前将效果应用。Scale transforms are applied to a visual before an effect is applied. 发生非统一的缩放转换时效果将使用较大的缩放值。In the event of a non-uniform scale transform, the effect will use the larger of the scale values.

可视化树的内容的最新更新VisualBrush如果将不会传播BitmapEffect画笔的父链中。Updates to the visual tree of a VisualBrush will not propagate if a BitmapEffect is in the brush's parent chain. 可以在效果的父对象上强制场景的更新来解决此限制。You can work around this limitation by forcing an update of the scene on the parent object of the effect. 您可以调用InvalidateVisual或包含一个动画,以强制场景的更新。You can call InvalidateVisual or include an animation to force a scene update.

自定义效果继承此类,以创建非托管效果的托管的接口。Custom effects inherit this class to create a managed interface to the unmanaged effect. 有关详细信息,请参阅非托管 BitmapEffect API。For more information, see the Unmanaged BitmapEffect API.

继承者说明

CreateUnmanagedEffect() 必须重写以初始化在托管代码中的非托管的效果。 CreateUnmanagedEffect() must be overridden to initialize an unmanaged effect in managed code.

UpdateUnmanagedPropertyState(SafeHandle) 必须重写时非托管的效果具有用户可以修改的属性。UpdateUnmanagedPropertyState(SafeHandle) must be overridden when an unmanaged effect has properties that the user can modify. 结合使用此方法SetValue(SafeHandle, String, Object)更新非托管的属性。Use this method in conjunction with SetValue(SafeHandle, String, Object) to update your unmanaged properties.

构造函数

BitmapEffect() BitmapEffect() BitmapEffect() BitmapEffect()

初始化 BitmapEffect 类的新实例。Initializes a new instance of the BitmapEffect class.

方法

ApplyAnimationClock(DependencyProperty, AnimationClock) ApplyAnimationClock(DependencyProperty, AnimationClock) ApplyAnimationClock(DependencyProperty, AnimationClock) ApplyAnimationClock(DependencyProperty, AnimationClock)

AnimationClock 应用到指定的 DependencyPropertyApplies an AnimationClock to the specified DependencyProperty. 如果该属性已进行动画处理,则使用 SnapshotAndReplace 切换行为。If the property is already animated, the SnapshotAndReplace handoff behavior is used.

(Inherited from Animatable)
ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior) ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior) ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior) ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior)

AnimationClock 应用到指定的 DependencyPropertyApplies an AnimationClock to the specified DependencyProperty. 如果该属性已进行动画处理,则使用指定的 HandoffBehaviorIf the property is already animated, the specified HandoffBehavior is used.

(Inherited from Animatable)
BeginAnimation(DependencyProperty, AnimationTimeline) BeginAnimation(DependencyProperty, AnimationTimeline) BeginAnimation(DependencyProperty, AnimationTimeline) BeginAnimation(DependencyProperty, AnimationTimeline)

将动画应用于指定 DependencyPropertyApplies an animation to the specified DependencyProperty. 动画会在呈现下一帧时启动。The animation is started when the next frame is rendered. 如果指定属性已进行动画处理,则使用 SnapshotAndReplace 切换行为。If the specified property is already animated, the SnapshotAndReplace handoff behavior is used.

(Inherited from Animatable)
BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior) BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior) BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior) BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior)

将动画应用于指定 DependencyPropertyApplies an animation to the specified DependencyProperty. 动画会在呈现下一帧时启动。The animation is started when the next frame is rendered. 如果指定的属性已进行动画处理,则使用指定的 HandoffBehaviorIf the specified property is already animated, the specified HandoffBehavior is used.

(Inherited from Animatable)
CheckAccess() CheckAccess() CheckAccess() CheckAccess()

确定调用线程是否具有访问此DispatcherObjectDetermines whether the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)
ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty)

清除属性的本地值。Clears the local value of a property. 要清除的属性由 DependencyProperty 标识符指定。The property to be cleared is specified by a DependencyProperty identifier.

(Inherited from DependencyObject)
ClearValue(DependencyPropertyKey) ClearValue(DependencyPropertyKey) ClearValue(DependencyPropertyKey) ClearValue(DependencyPropertyKey)

清除只读属性的本地值。Clears the local value of a read-only property. 要清除的属性由 DependencyPropertyKey 指定。The property to be cleared is specified by a DependencyPropertyKey.

(Inherited from DependencyObject)
Clone() Clone() Clone() Clone()

创建此 BitmapEffect 的可修改克隆,从而深度复制此对象的值。Creates a modifiable clone of this BitmapEffect, making deep copies of this object's values. 在复制依赖项属性时,此方法会复制资源引用和数据绑定(但可能不再解析),但不复制动画或其当前值。When copying dependency properties, this method copies resource references and data bindings (but they might no longer resolve) but not animations or their current values.

CloneCore(Freezable) CloneCore(Freezable) CloneCore(Freezable) CloneCore(Freezable)

使用基(未经过动画处理的)属性值使该实例成为指定 Freezable 的克隆(深层复制)。Makes the instance a clone (deep copy) of the specified Freezable using base (non-animated) property values.

(Inherited from Freezable)
CloneCurrentValue() CloneCurrentValue() CloneCurrentValue() CloneCurrentValue()

创建此 BitmapEffect 对象的可修改复本,从而深度复制此对象的当前值。Creates a modifiable clone of this BitmapEffect object, making deep copies of this object's current values. 不复制资源引用、数据绑定和动画,而是复制其当前值。Resource references, data bindings, and animations are not copied, but their current values are.

CloneCurrentValueCore(Freezable) CloneCurrentValueCore(Freezable) CloneCurrentValueCore(Freezable) CloneCurrentValueCore(Freezable)

使用当前属性值使该实例成为指定 Freezable 的可修改克隆(深层复制)。Makes the instance a modifiable clone (deep copy) of the specified Freezable using current property values.

(Inherited from Freezable)
CoerceValue(DependencyProperty) CoerceValue(DependencyProperty) CoerceValue(DependencyProperty) CoerceValue(DependencyProperty)

对指定依赖属性的值进行强制。Coerces the value of the specified dependency property. 通过对调用方 DependencyObject 上存在的依赖属性的属性元数据中所指定的任何 CoerceValueCallback 函数进行调用来完成此操作。This is accomplished by invoking any CoerceValueCallback function specified in property metadata for the dependency property as it exists on the calling DependencyObject.

(Inherited from DependencyObject)
CreateBitmapEffectOuter() CreateBitmapEffectOuter() CreateBitmapEffectOuter() CreateBitmapEffectOuter()

对用于初始化自定义效果的 IMILBitmapEffect 对象创建句柄。Creates a handle to an IMILBitmapEffect object that is used to initialize a custom effect.

CreateInstance() CreateInstance() CreateInstance() CreateInstance()

初始化 Freezable 类的新实例。Initializes a new instance of the Freezable class.

(Inherited from Freezable)
CreateInstanceCore() CreateInstanceCore() CreateInstanceCore() CreateInstanceCore()

在派生类中实现时,将创建的新实例Freezable派生的类。When implemented in a derived class, creates a new instance of the Freezable derived class.

(Inherited from Freezable)
CreateUnmanagedEffect() CreateUnmanagedEffect() CreateUnmanagedEffect() CreateUnmanagedEffect()

当在派生类中重写时创建非托管效果的复本。When overridden in a derived class, creates a clone of the unmanaged effect.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定提供的 DependencyObject 是否等效于当前 DependencyObjectDetermines whether a provided DependencyObject is equivalent to the current DependencyObject.

(Inherited from DependencyObject)
Freeze() Freeze() Freeze() Freeze()

使当前对象不可修改,并且将其 IsFrozen 属性设置为 trueMakes the current object unmodifiable and sets its IsFrozen property to true.

(Inherited from Freezable)
FreezeCore(Boolean) FreezeCore(Boolean) FreezeCore(Boolean) FreezeCore(Boolean)

使此 Animatable 对象成为不可修改的对象,或确定是否可使其成为不可修改的对象。Makes this Animatable object unmodifiable or determines whether it can be made unmodifiable.

(Inherited from Animatable)
GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty)

返回指定的 DependencyProperty 的未经过动画处理的值。Returns the non-animated value of the specified DependencyProperty.

(Inherited from Animatable)
GetAsFrozen() GetAsFrozen() GetAsFrozen() GetAsFrozen()

创建的冻结的副本Freezable,使用基 (非动画的) 属性值。Creates a frozen copy of the Freezable, using base (non-animated) property values. 因为副本被冻结,通过引用复制任何冻结的子对象。Because the copy is frozen, any frozen sub-objects are copied by reference.

(Inherited from Freezable)
GetAsFrozenCore(Freezable) GetAsFrozenCore(Freezable) GetAsFrozenCore(Freezable) GetAsFrozenCore(Freezable)

让该实例成为指定的 Freezable 的冻结克隆,前者使用基(非动画的)属性值。Makes the instance a frozen clone of the specified Freezable using base (non-animated) property values.

(Inherited from Freezable)
GetCurrentValueAsFrozen() GetCurrentValueAsFrozen() GetCurrentValueAsFrozen() GetCurrentValueAsFrozen()

创建的冻结的副本Freezable使用当前属性值。Creates a frozen copy of the Freezable using current property values. 因为副本被冻结,通过引用复制任何冻结的子对象。Because the copy is frozen, any frozen sub-objects are copied by reference.

(Inherited from Freezable)
GetCurrentValueAsFrozenCore(Freezable) GetCurrentValueAsFrozenCore(Freezable) GetCurrentValueAsFrozenCore(Freezable) GetCurrentValueAsFrozenCore(Freezable)

使当前实例成为指定 Freezable 的冻结克隆。Makes the current instance a frozen clone of the specified Freezable. 如果对象具有动画依赖属性,则复制其当前的动画值。If the object has animated dependency properties, their current animated values are copied.

(Inherited from Freezable)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

获取此 DependencyObject 的哈希代码。Gets a hash code for this DependencyObject.

(Inherited from DependencyObject)
GetLocalValueEnumerator() GetLocalValueEnumerator() GetLocalValueEnumerator() GetLocalValueEnumerator()

创建一个专用的枚举数,用于确定哪些依赖项属性在此 DependencyObject 上具有以本地方式设置的值。Creates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject.

(Inherited from DependencyObject)
GetOutput(BitmapEffectInput) GetOutput(BitmapEffectInput) GetOutput(BitmapEffectInput) GetOutput(BitmapEffectInput)

返回BitmapSource中时得到时该效果应用到指定BitmapEffectInputReturns the BitmapSource that results when the effect is applied to the specified BitmapEffectInput.

GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty)

DependencyObject 的此实例返回依赖属性的当前有效值。Returns the current effective value of a dependency property on this instance of a DependencyObject.

(Inherited from DependencyObject)
InitializeBitmapEffect(SafeHandle, SafeHandle) InitializeBitmapEffect(SafeHandle, SafeHandle) InitializeBitmapEffect(SafeHandle, SafeHandle) InitializeBitmapEffect(SafeHandle, SafeHandle)

使用给定的 IMILBitmapEffectPrimitive 初始化从 CreateBitmapEffectOuter() 获取的 IMILBitmapEffect 句柄。Initializes an IMILBitmapEffect handle obtained from CreateBitmapEffectOuter() with the given IMILBitmapEffectPrimitive.

InvalidateProperty(DependencyProperty) InvalidateProperty(DependencyProperty) InvalidateProperty(DependencyProperty) InvalidateProperty(DependencyProperty)

重新计算指定依赖项属性的有效值Re-evaluates the effective value for the specified dependency property

(Inherited from DependencyObject)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
OnChanged() OnChanged() OnChanged() OnChanged()

修改当前 Freezable 对象时调用。Called when the current Freezable object is modified.

(Inherited from Freezable)
OnFreezablePropertyChanged(DependencyObject, DependencyObject) OnFreezablePropertyChanged(DependencyObject, DependencyObject) OnFreezablePropertyChanged(DependencyObject, DependencyObject) OnFreezablePropertyChanged(DependencyObject, DependencyObject)

确保为建立了适当的上下文指针DependencyObjectType刚刚设置的数据成员。Ensures that appropriate context pointers are established for a DependencyObjectType data member that has just been set.

(Inherited from Freezable)
OnFreezablePropertyChanged(DependencyObject, DependencyObject, DependencyProperty) OnFreezablePropertyChanged(DependencyObject, DependencyObject, DependencyProperty) OnFreezablePropertyChanged(DependencyObject, DependencyObject, DependencyProperty) OnFreezablePropertyChanged(DependencyObject, DependencyObject, DependencyProperty)

此成员支持 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基础结构,但不能在代码中直接使用。This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

(Inherited from Freezable)
OnPropertyChanged(DependencyPropertyChangedEventArgs) OnPropertyChanged(DependencyPropertyChangedEventArgs) OnPropertyChanged(DependencyPropertyChangedEventArgs) OnPropertyChanged(DependencyPropertyChangedEventArgs)

重写 OnPropertyChanged(DependencyPropertyChangedEventArgs)DependencyObject 实现,以同时调用任何响应类型 Freezable 不断变化的依赖属性的 Changed 处理程序。Overrides the DependencyObject implementation of OnPropertyChanged(DependencyPropertyChangedEventArgs) to also invoke any Changed handlers in response to a changing dependency property of type Freezable.

(Inherited from Freezable)
ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty)

如果存在,则返回依赖属性的本地值。Returns the local value of a dependency property, if it exists.

(Inherited from DependencyObject)
ReadPreamble() ReadPreamble() ReadPreamble() ReadPreamble()

确保Freezable正在从有效线程访问。Ensures that the Freezable is being accessed from a valid thread. 继承者Freezable必须调用此方法的任何开头APIAPI读取不属于依赖项属性的数据成员。Inheritors of Freezable must call this method at the beginning of any APIAPI that reads data members that are not dependency properties.

(Inherited from Freezable)
SetCurrentValue(DependencyProperty, Object) SetCurrentValue(DependencyProperty, Object) SetCurrentValue(DependencyProperty, Object) SetCurrentValue(DependencyProperty, Object)

设置依赖属性的值而不更改其值源。Sets the value of a dependency property without changing its value source.

(Inherited from DependencyObject)
SetValue(DependencyProperty, Object) SetValue(DependencyProperty, Object) SetValue(DependencyProperty, Object) SetValue(DependencyProperty, Object)

设置依赖属性的本地值,该值由其依赖属性标识符指定。Sets the local value of a dependency property, specified by its dependency property identifier.

(Inherited from DependencyObject)
SetValue(DependencyPropertyKey, Object) SetValue(DependencyPropertyKey, Object) SetValue(DependencyPropertyKey, Object) SetValue(DependencyPropertyKey, Object)

设置一个只读依赖属性的本地值,该值由依赖属性的 DependencyPropertyKey 标识符指定。Sets the local value of a read-only dependency property, specified by the DependencyPropertyKey identifier of the dependency property.

(Inherited from DependencyObject)
SetValue(SafeHandle, String, Object) SetValue(SafeHandle, String, Object) SetValue(SafeHandle, String, Object) SetValue(SafeHandle, String, Object)

指定的属性设置为给定的值。Sets the specified property to the given value.

ShouldSerializeProperty(DependencyProperty) ShouldSerializeProperty(DependencyProperty) ShouldSerializeProperty(DependencyProperty) ShouldSerializeProperty(DependencyProperty)

返回一个值,该值指示序列化进程是否应序列化所提供的依赖属性的值。Returns a value that indicates whether serialization processes should serialize the value for the provided dependency property.

(Inherited from DependencyObject)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)
UpdateUnmanagedPropertyState(SafeHandle) UpdateUnmanagedPropertyState(SafeHandle) UpdateUnmanagedPropertyState(SafeHandle) UpdateUnmanagedPropertyState(SafeHandle)

当在派生类中重写,更新效果的非托管属性的属性状态。When overridden in a derived class, updates the property states of the unmanaged properties of the effect.

VerifyAccess() VerifyAccess() VerifyAccess() VerifyAccess()

强制执行调用线程可以访问此DispatcherObjectEnforces that the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)
WritePostscript() WritePostscript() WritePostscript() WritePostscript()

引发 FreezableChanged 事件并调用其 OnChanged() 方法。Raises the Changed event for the Freezable and invokes its OnChanged() method. Freezable 派生的类应在修改的类成员不存储为依赖属性的任何 API 的末尾调用此方法。Classes that derive from Freezable should call this method at the end of any API that modifies class members that are not stored as dependency properties.

(Inherited from Freezable)
WritePreamble() WritePreamble() WritePreamble() WritePreamble()

验证Freezable是否未被冻结并正在从有效的线程上下文访问。Verifies that the Freezable is not frozen and that it is being accessed from a valid threading context. Freezable 继承类应调用此方法的任何开头APIAPI写入不属于依赖项属性的数据成员。Freezable inheritors should call this method at the beginning of any APIAPI that writes to data members that are not dependency properties.

(Inherited from Freezable)

属性

CanFreeze CanFreeze CanFreeze CanFreeze

获取一个值,该值指示是否可将对象变为不可修改。Gets a value that indicates whether the object can be made unmodifiable.

(Inherited from Freezable)
DependencyObjectType DependencyObjectType DependencyObjectType DependencyObjectType

获取对此实例的 CLRCLR 类型进行包装的 DependencyObjectTypeGets the DependencyObjectType that wraps the CLRCLR type of this instance.

(Inherited from DependencyObject)
Dispatcher Dispatcher Dispatcher Dispatcher

获取DispatcherDispatcherObject与相关联。Gets the Dispatcher this DispatcherObject is associated with.

(Inherited from DispatcherObject)
HasAnimatedProperties HasAnimatedProperties HasAnimatedProperties HasAnimatedProperties

获取一个值,该值指示一个或多个 AnimationClock 对象是否与此对象的任何依赖项属性相关联。Gets a value that indicates whether one or more AnimationClock objects is associated with any of this object's dependency properties.

(Inherited from Animatable)
IsFrozen IsFrozen IsFrozen IsFrozen

获取一个值,该值指示对象当前是否可修改。Gets a value that indicates whether the object is currently modifiable.

(Inherited from Freezable)
IsSealed IsSealed IsSealed IsSealed

获取一个值,该值指示此实例当前是否为密封的(只读)。Gets a value that indicates whether this instance is currently sealed (read-only).

(Inherited from DependencyObject)

事件

Changed Changed Changed Changed

发生时Freezable或修改其包含的对象。Occurs when the Freezable or an object it contains is modified.

(Inherited from Freezable)

安全性

UIPermission
用于继承BitmapEffect类。for inheriting the BitmapEffect class. 关联的枚举: AllWindowsAssociated enumerations: AllWindows

适用于

另请参阅