Click or drag to resize
Pixel formats

The DirectXPixelFormat enum includes all the many and varied pixel formats used by Direct3D and DXGI, but only a few of these options are supported by Win2D (or by Direct2D upon which Win2D is built).

If in doubt, pixel format B8G8R8A8UIntNormalized and CanvasAlphaMode Premultiplied are good defaults for most purposes.

All the formats listed below are supported by Direct3D feature level 11 GPU hardware (used in desktop computers and most tablets). Feature level 9 GPUs (which are found in phones) only support a subset. If you want to use one of the formats marked as Not supported on all devices, you should first check IsPixelFormatSupported(DirectXPixelFormat), or catch exceptions if the resource creation fails and be prepared to fall back on one of the universally available options.

CanvasBitmap formats
DirectXPixelFormatCompatible CanvasAlphaModesNotes
B8G8R8A8UIntNormalizedPremultiplied, IgnoreThe default format
B8G8R8A8UIntNormalizedSrgbPremultiplied, IgnoreNot supported on all devices
B8G8R8X8UIntNormalizedIgnore
R8G8B8A8UIntNormalizedPremultiplied, Ignore
R8G8B8A8UIntNormalizedSrgbPremultiplied, IgnoreNot supported on all devices
R16G16B16A16FloatPremultiplied, IgnoreNot supported on all devices
R32G32B32A32FloatPremultiplied, IgnoreNot supported on all devices
R10G10B10A2UIntNormalizedPremultiplied, IgnoreNot supported on all devices
R16G16B16A16UIntNormalizedPremultiplied, IgnoreNot supported on all devices
R8G8UIntNormalizedIgnoreNot supported on all devices. Bitmaps of this format can be used as effect sources, but are not directly drawable.
R8UIntNormalizedIgnoreNot supported on all devices. Bitmaps of this format can be used as effect sources, but are not directly drawable.
A8UIntNormalizedPremultiplied, StraightBitmaps of this format can be used as opacity masks or effect sources, but are not directly drawable.
BC1UIntNormalizedPremultiplied, Ignore
BC2UIntNormalizedPremultiplied, Ignore
BC3UIntNormalizedPremultiplied, Ignore
CanvasRenderTarget formats
DirectXPixelFormatCompatible CanvasAlphaModesNotes
B8G8R8A8UIntNormalizedPremultiplied, IgnoreThe default format
B8G8R8A8UIntNormalizedSrgbPremultiplied, IgnoreNot supported on all devices
R8G8B8A8UIntNormalizedPremultiplied, Ignore
R8G8B8A8UIntNormalizedSrgbPremultiplied, IgnoreNot supported on all devices
R16G16B16A16FloatPremultiplied, IgnoreNot supported on all devices
R32G32B32A32FloatPremultiplied, IgnoreNot supported on all devices
R16G16B16A16UIntNormalizedPremultiplied, IgnoreNot supported on all devices
A8UIntNormalizedPremultiplied, Straight
CanvasSwapChain formats
DirectXPixelFormatCompatible CanvasAlphaModesNotes
B8G8R8A8UIntNormalizedPremultiplied, IgnoreThe default format
R8G8B8A8UIntNormalizedPremultiplied, Ignore
R16G16B16A16FloatPremultiplied, IgnoreNot supported on all devices