Click or drag to resize
CanvasBitmapCreateFromSoftwareBitmap Method
Creates a CanvasBitmap from a SoftwareBitmap.

Namespace:  Microsoft.Graphics.Canvas
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version: 0.0.0.0
Syntax
C#
public static CanvasBitmap CreateFromSoftwareBitmap(
	ICanvasResourceCreator resourceCreator,
	SoftwareBitmap sourceBitmap
)

Parameters

resourceCreator
Type: Microsoft.Graphics.CanvasICanvasResourceCreator
sourceBitmap
Type: Windows.Graphics.ImagingSoftwareBitmap

Return Value

Type: CanvasBitmap
Remarks

The CanvasBitmap's Format is determined from the SoftwareBitmap's BitmapPixelFormat property. Not all BitmapPixelFormats are supported by CanvasBitmap. See Pixel Formats for more details.

The following table shows how each BitmapPixelFormat is interpreted:

sourceBitmap's BitmapPixelFormatCanvasBitmap's Format
BitmapPixelFormat.Unknownunsupported
BitmapPixelFormat.Rgba16DirectXPixelFormat.R16G16B16A16UIntNormalized
BitmapPixelFormat.Rgba8DirectXPixelFormat.R8G8B8A8UIntNormalized
BitmapPixelFormat.Gray16unsupported
BitmapPixelFormat.Gray8DirectXPixelFormat.A8UIntNormalized
BitmapPixelFormat.Bgra8DirectXPixelFormat.B8G8R8A8UIntNormalized
BitmapPixelFormat.Nv12unsupported
BitmapPixelFormat.Yuy2unsupported
See Also