Manager.CheckDeviceFormatConversion Method

Language:

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

Definition

Visual Basic Public Shared Function CheckDeviceFormatConversion( _
    ByVal adapter As Integer, _
    ByVal deviceType As DeviceType, _
    ByVal sourceFormat As Format, _
    ByVal targetFormat As Format _
) As Boolean
C# public static bool CheckDeviceFormatConversion(
    int adapter,
    DeviceType deviceType,
    Format sourceFormat,
    Format targetFormat
);
C++ public:
static bool CheckDeviceFormatConversion(
    int adapter,
    DeviceType deviceType,
    Format sourceFormat,
    Format targetFormat
);
JScript public static function CheckDeviceFormatConversion(
    adapter : int,
    deviceType : DeviceType,
    sourceFormat : Format,
    targetFormat : Format
) : boolean;

Parameters

adapter System.Int32
Display adapter ordinal number. AdapterListCollection.Default is always the primary display adapter. This method returns ResultCode.InvalidCall when the value equals or exceeds the number of display adapters in the system.
deviceType Microsoft.DirectX.Direct3D.DeviceType
Device type. Member of the DeviceType enumeration.
sourceFormat Microsoft.DirectX.Direct3D.Format
Source adapter format. Member of the Format enumeration.
targetFormat Microsoft.DirectX.Direct3D.Format
Target adapter format. Member of the Format enumeration.

Return Value

System.Boolean
Returns true if the method succeeds; false if it fails. Check the result parameter for the HRESULT code returned.

If the method fails, result is set to ResultCode.InvalidCall.

If the hardware does not support conversion between the two formats, result is set to ResultCode.NotAvailable.

Remarks

Using Manager.CheckDeviceType 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 ResultCode.NotAvailable. If the device can render to the format but cannot perform the color-converting presentation, the return value is also ResultCode.NotAvailable. Applications can discover hardware support for the presentation itself by calling Manager.CheckDeviceFormatConversion. No software emulation for the color-converting presentation itself is offered.

Manager.CheckDeviceFormatConversion also can be used to determine which combinations of source surface formats and destination surface formats are permissible in calls to Device.StretchRectangle.

Color conversion is restricted to the following source and target formats.

See Also


Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.

Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center