Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

BitmapEffect.InitializeBitmapEffect Method

Note: This API is now obsolete. The non-obsolete alternative is Effect.

Initializes an IMILBitmapEffect handle obtained from CreateBitmapEffectOuter with the given IMILBitmapEffectPrimitive.

Namespace:  System.Windows.Media.Effects
Assembly:  PresentationCore (in PresentationCore.dll)
[ObsoleteAttribute("BitmapEffects are deprecated and no longer function.  Consider using Effects where appropriate instead.")]
protected static void InitializeBitmapEffect(
	SafeHandle outerObject,
	SafeHandle innerObject
)

Parameters

outerObject
Type: System.Runtime.InteropServices.SafeHandle

The outer IMILBitmapEffect wrapper to initialize.

innerObject
Type: System.Runtime.InteropServices.SafeHandle

The inner IMILBitmapEffectPrimitive.

The following example shows an implementation of CreateUnmanagedEffect that uses the InitializeBitmapEffect method to initialize the wrapper object with the custom effect.

        [SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
        unsafe protected override SafeHandle CreateUnmanagedEffect()
        {
            const uint CLSCTX_INPROC_SERVER = 1;
            Guid IID_IUnknown = new Guid("00000000-0000-0000-C000-000000000046");
            Guid guidEffectCLSID = new Guid("84CF07CC-34C4-460f-B435-3184F5F2FF2A");
            SafeHandle wrapper = BitmapEffect.CreateBitmapEffectOuter();

            COMSafeHandle unmanagedEffect;
            uint hresult = Ole32Methods.CoCreateInstance(
								ref guidEffectCLSID,
								wrapper.DangerousGetHandle(),
								CLSCTX_INPROC_SERVER,
								ref IID_IUnknown,
								out unmanagedEffect);
            InitializeBitmapEffect(wrapper, unmanagedEffect);
            if (0 == hresult) return wrapper;
            throw new Exception("Cannot instantiate effect. HRESULT = " + hresult.ToString());
        }

.NET Framework

Supported in: 3.5, 3.0
Obsolete (compiler warning) in 4.5.1
Obsolete (compiler warning) in 4.5
Obsolete (compiler warning) in 4

.NET Framework Client Profile

Supported in: 3.5 SP1
Obsolete (compiler warning) in 4

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.