BitmapEffect.CreateBitmapEffectOuter 메서드

정의

주의

BitmapEffects are deprecated and no longer function. Consider using Effects where appropriate instead.

사용자 지정 효과를 초기화하는 데 사용되는 IMILBitmapEffect 개체에 대한 핸들을 만듭니다.Creates a handle to an IMILBitmapEffect object that is used to initialize a custom effect.

protected:
 static System::Runtime::InteropServices::SafeHandle ^ CreateBitmapEffectOuter();
[System.Obsolete("BitmapEffects are deprecated and no longer function.  Consider using Effects where appropriate instead.")]
protected static System.Runtime.InteropServices.SafeHandle CreateBitmapEffectOuter ();
[System.Security.SecurityCritical]
[System.Security.SecurityTreatAsSafe]
protected static System.Runtime.InteropServices.SafeHandle CreateBitmapEffectOuter ();
[System.Obsolete("BitmapEffects are deprecated and no longer function.  Consider using Effects where appropriate instead.")]
[System.Security.SecurityCritical]
[System.Security.SecurityTreatAsSafe]
protected static System.Runtime.InteropServices.SafeHandle CreateBitmapEffectOuter ();
[<System.Obsolete("BitmapEffects are deprecated and no longer function.  Consider using Effects where appropriate instead.")>]
static member CreateBitmapEffectOuter : unit -> System.Runtime.InteropServices.SafeHandle
[<System.Security.SecurityCritical>]
[<System.Security.SecurityTreatAsSafe>]
static member CreateBitmapEffectOuter : unit -> System.Runtime.InteropServices.SafeHandle
[<System.Obsolete("BitmapEffects are deprecated and no longer function.  Consider using Effects where appropriate instead.")>]
[<System.Security.SecurityCritical>]
[<System.Security.SecurityTreatAsSafe>]
static member CreateBitmapEffectOuter : unit -> System.Runtime.InteropServices.SafeHandle
Protected Shared Function CreateBitmapEffectOuter () As SafeHandle

반환

SafeHandle

IMILBitmapEffect 개체에 대한 핸들입니다.A handle to an IMILBitmapEffect object.

특성

예제

다음 예제에서는 CreateUnmanagedEffect 메서드를 사용 하 여 CreateBitmapEffectOuter 래퍼 효과 개체를 검색 하는의 구현을 보여 줍니다.The following example shows an implementation of CreateUnmanagedEffect that uses the CreateBitmapEffectOuter method to retrieve a wrapper effect object.

[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

설명

사용자 지정 효과와 프레임 워크 상호 작용은 IMILBitmapEffect 개체를 통해 처리 됩니다.Framework interaction with custom effects is handled through an IMILBitmapEffect object. 외부 효과는 메서드를 통해 사용자 지정 효과를 사용 하 여 초기화 됩니다 InitializeBitmapEffect .The outer effect is initialized with the custom effect through the InitializeBitmapEffect method.

적용 대상