ID2D1Factory1::RegisterEffectFromString method
Registers an effect within the factory instance with the property XML specified as a string.
Syntax
HRESULT RegisterEffectFromString( [in] REFCLSID classId, [in] PCWSTR propertyXml, [in, optional] const D2D1_PROPERTY_BINDING *Bindings, UINT32 bindingsCount, PD2D1_EFFECT_FACTORY effectFactory );
Parameters
- classId [in]
-
Type: REFCLSID
The identifier of the effect to be registered.
- propertyXml [in]
-
Type: PCWSTR
A list of the effect properties, types, and metadata.
- Bindings [in, optional]
-
Type: const D2D1_PROPERTY_BINDING*
An array of properties and methods.
This binds a property by name to a particular method implemented by the effect author to handle the property. The name must be found in the corresponding propertyXml.
- bindingsCount
-
Type: UINT32
The number of bindings in the binding array.
- effectFactory
-
Type: PD2D1_EFFECT_FACTORY
The static factory that is used to create the corresponding effect.
Return value
Type: HRESULT
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
| HRESULT | Description |
|---|---|
| S_OK | No error occurred. |
| E_OUTOFMEMORY | Direct2D could not allocate sufficient memory to complete the call. |
| E_INVALIDARG | An invalid parameter was passed to the returning function. |
Remarks
Direct2D effects must define their properties at registration time via registration XML. An effect declares several required system properties, and can also declare custom properties. See Custom effects for more information about formatting the propertyXml parameter.
RegisterEffect is both atomic and reference counted. To unregister an effect, call UnregisterEffect with the classId of the effect.
Aside from the built-in effects that are globally registered, this API registers effects only for this factory and derived device and device context interfaces.
Requirements
|
Minimum supported client |
Windows 8 and Platform Update for Windows 7 [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | Windows Store apps] |
|
Minimum supported phone |
Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps] |
|
Header |
|
|
Library |
|
|
DLL |
|
See also