Click or drag to resize
CanvasBitmap.CreateFromDirect3D11Surface Method (ICanvasResourceCreator, IDirect3DSurface, Single)
Creates a CanvasBitmap from an existing Direct3D graphics surface.

Namespace:  Microsoft.Graphics.Canvas
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version: 0.0.0.0
Syntax
C#
public static CanvasBitmap CreateFromDirect3D11Surface(
	ICanvasResourceCreator resourceCreator,
	IDirect3DSurface surface,
	float dpi
)

Parameters

resourceCreator
Type: Microsoft.Graphics.Canvas.ICanvasResourceCreator
surface
Type: Windows.Graphics.DirectX.Direct3D11.IDirect3DSurface
dpi
Type: System.Single

Return Value

Type: CanvasBitmap
Remarks

The bitmap's properties are determined by the properties of the surface. If the surface is able to be used as a render target then a CanvasRenderTarget instance is actually returned. However, to avoid needing to cast, use CreateFromDirect3D11Surface(ICanvasResourceCreator, IDirect3DSurface).

The value of AlphaMode is determined by the pixel format of the surface. If the surface supports alpha, then the AlphaMode is set to CanvasAlphaMode.Premultiplied, otherwise it is set to CanvasAlphaMode.Ignore. See Pixel Formats for more information about which formats support which alpha modes.

See Also