ISurfaceImageSourceNativeWithD2D::SetDevice method (windows.ui.xaml.media.dxinterop.h)

Sets the Microsoft DirectX Graphics Infrastructure (DXGI) or Direct2D device, created with D3D11_CREATE_DEVICE_BGRA_SUPPORT, that will draw the surface.

Syntax

HRESULT SetDevice(
  [in] IUnknown *device
);

Parameters

[in] device

Pointer to the DXGI device interface. You can pass an ID2D1Device to signal that this surface participates in Direct2D batching to improve performance when updating Direct2D content across multiple surfaces. The device must have multithreading supported enabled if the app draws to the surface from a background thread.

Return value

This method fails when the SurfaceImageSource is larger than the maximum texture size supported by the Direct3D device. Apps should use VirtualSurfaceImageSource for surfaces larger than the maximum texture size supported by the Direct3D device.

Requirements

Requirement Value
Minimum supported client Windows 8.1 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 R2 [desktop apps | UWP apps]
Target Platform Windows
Header windows.ui.xaml.media.dxinterop.h
DLL Windows.UI.Xaml.dll

See also

DirectX and XAML interop

ISurfaceImageSourceNativeWithD2D

SurfaceImageSource

VirtualSurfaceImageSource