smourier / DirectN

Direct interop Code for .NET Framework, .NET Core and .NET 5+ : DXGI, WIC, DirectX 9 to 12, Direct2D, Direct Write, Direct Composition, Media Foundation, WASAPI, CodecAPI, GDI, Spatial Audio, DVD, Windows Media Player, UWP DXInterop, WinUI3, etc.
MIT License
311 stars 28 forks source link

Creating IDCompositionGaussianBlurEffect returns E_NOINTERFACE #13

Closed selastingeorge closed 3 years ago

selastingeorge commented 3 years ago

I have been trying to create blur Effect using IDCompositionGaussianBlurEffectbut when i create the effect using IDCompositionDevice3it throws exception with this message:

System.InvalidCastException: 'No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))'

Here is the code which throws the exception :

hr = dcompDevice3.Object.CreateGaussianBlurEffect(out var gauss);

smourier commented 3 years ago

We're still working on the sample code. It's not ready yet.

You cannot use use the "old" Dcomp.dll (IDCompositionDevice1/2/3) for the acrylic brush (effect hierarchies), you must use WinRT's Windows.UI.Composition (for which you don't need DirectN).

selastingeorge commented 3 years ago

I am trying to create mica support for Windows 8,8.1,10,11, so the WinRT API won't work with the DWM Private function that i use, if need to make it work i need to create an interop compositor to convert IDCompositionVisual to Windows.UI.Composition.Visual, and even though i use Windows.UI.Composition.Visual it is only supported in Windows 10, so there is no backward compatibility.

Sorry for opening multiple issues. i will close it.