BitmapEffect.InitializeBitmapEffect(SafeHandle, SafeHandle) BitmapEffect.InitializeBitmapEffect(SafeHandle, SafeHandle) BitmapEffect.InitializeBitmapEffect(SafeHandle, SafeHandle) BitmapEffect.InitializeBitmapEffect(SafeHandle, SafeHandle) Method

定義

警告

この API は現在使われていません。

指定した IMILBitmapEffectPrimitive を使用して CreateBitmapEffectOuter() から取得した IMILBitmapEffect ハンドルを初期化します。Initializes an IMILBitmapEffect handle obtained from CreateBitmapEffectOuter() with the given IMILBitmapEffectPrimitive.

protected:
 static void InitializeBitmapEffect(System::Runtime::InteropServices::SafeHandle ^ outerObject, System::Runtime::InteropServices::SafeHandle ^ innerObject);
[System.Obsolete("BitmapEffects are deprecated and no longer function.  Consider using Effects where appropriate instead.")]
[System.Security.SecurityCritical]
[System.Security.SecurityTreatAsSafe]
protected static void InitializeBitmapEffect (System.Runtime.InteropServices.SafeHandle outerObject, System.Runtime.InteropServices.SafeHandle innerObject);
static member InitializeBitmapEffect : System.Runtime.InteropServices.SafeHandle * System.Runtime.InteropServices.SafeHandle -> unit
Protected Shared Sub InitializeBitmapEffect (outerObject As SafeHandle, innerObject As SafeHandle)

パラメーター

outerObject
SafeHandle SafeHandle SafeHandle SafeHandle

初期化する外部 IMILBitmapEffect ラッパー。The outer IMILBitmapEffect wrapper to initialize.

innerObject
SafeHandle SafeHandle SafeHandle SafeHandle

内部 IMILBitmapEffectPrimitive。The inner IMILBitmapEffectPrimitive.

次の例の実装を示しています。CreateUnmanagedEffectを使用して、InitializeBitmapEffectカスタム効果のラッパー オブジェクトを初期化します。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());
}
<SecurityPermissionAttribute(SecurityAction.Demand, Flags := SecurityPermissionFlag.UnmanagedCode)>
Protected Overrides Function CreateUnmanagedEffect() As SafeHandle
	Const CLSCTX_INPROC_SERVER As UInteger = 1
	Dim IID_IUnknown As New Guid("00000000-0000-0000-C000-000000000046")
	Dim guidEffectCLSID As New Guid("84CF07CC-34C4-460f-B435-3184F5F2FF2A")
	Dim wrapper As SafeHandle = BitmapEffect.CreateBitmapEffectOuter()

	Dim unmanagedEffect As COMSafeHandle
	Dim hresult As UInteger = Ole32Methods.CoCreateInstance(guidEffectCLSID, wrapper.DangerousGetHandle(), CLSCTX_INPROC_SERVER, IID_IUnknown, unmanagedEffect)
	InitializeBitmapEffect(wrapper, unmanagedEffect)
	If 0 = hresult Then
		Return wrapper
	End If
	Throw New Exception("Cannot instantiate effect. HRESULT = " & hresult.ToString())
End Function

適用対象