smourier/DirectN

D2D1_LAYER_PARAMETERS1 geometricMask

miquik opened this issue · 2 comments

Hi,
I'm try to fill D2D1_LAYER_PARAMETERS1 structure to call PushLayer. If I understand correctly I have to pass my clipping geometry (as ID2D1Geometry) in the geometricMask field of this structure.

But how should I convert ID2D1Geometry to IntPtr?

Thanks

Hi,

You can use Marshal.GetIUnknownForObject(geometryObject)

Thanks @smourier . For some reason your solution doesn't work.
Anyway I got it worked using: Marshal.GetComInterfaceForObject(clip, typeof(ID2D1Geometry));

Thanks again