GraphicsAdapter.CheckDeviceFormatConversion Method

Tests a device to determine whether it supports conversion from one display format to another.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

public bool CheckDeviceFormatConversion (
         DeviceType deviceType,
         SurfaceFormat sourceFormat,
         SurfaceFormat targetFormat


Type of device to check.
Source adapter format.
Target adapter format.

Return Value

true if the method succeeds; false if it fails.

Exception typeCondition
DeviceNotSupportedException(Xbox 360) Hardware is the only device type supported on this platform.

Using CheckDeviceFormatConversion to test for compatibility between a back buffer and the display format returns appropriate values. This means that the call reflects device capabilities. If the device cannot render to the requested back buffer format, the call still returns false. If the device can render to the format but cannot perform the color-converting presentation, the return value is also false. Applications can discover hardware support for the presentation itself by calling CheckDeviceFormatConversion. No software emulation for the color-converting presentation itself is offered.

Color conversion is restricted to certain source and target formats. The source format must be a four-character code (FOURCC) format or a valid back-buffer format, and the target format must be one of the following unsigned formats.


Xbox 360, Windows XP SP2, Windows Vista