0

我想知道是否有可能以某种方式为给定的 xaml 控件的合成器调用此 API 函数: https ://msdn.microsoft.com/en-ca/library/windows/apps/mt620066?f=255&MSPPError=-2147217396

我在想的是这些方面的东西:

    // Get the graphics device for the compositor
    auto compositor = Window::Current().Compositor();
    com_ptr<ICompositorInterop> comp_interop{ compositor.as<ICompositorInterop> };
    com_ptr<ICompositionGraphicsDevice> m_compgd{nullptr};
    comp_interop->GetGraphicsDevice(m_compgd.put()); // This doesn't actually exist.

    // Get the rendering device
    com_ptr<ICompositionGraphicsDeviceInterop> compgd_interop{m_compgd.as<ICompositionGraphicsDeviceInterop>()};
    com_ptr<IUnknown> m_device{ nullptr };
    check_hresult(
        compgd_interop->GetRenderingDevice(m_device.put())
    );

除了显然这不起作用,因为没有GetGraphicsDevice可用的功能,只有CreateGraphicsDevice.

4

0 回答 0