Manager.CheckDeviceType メソッド
アセンブリ: Microsoft.WindowsMobile.DirectX (microsoft.windowsmobile.directx.dll 内)

Public Shared Function CheckDeviceType ( _ adapter As Integer, _ checkType As DeviceType, _ displayFormat As Format, _ backBufferFormat As Format, _ windowed As Boolean _ ) As Boolean
Dim adapter As Integer Dim checkType As DeviceType Dim displayFormat As Format Dim backBufferFormat As Format Dim windowed As Boolean Dim returnValue As Boolean returnValue = Manager.CheckDeviceType(adapter, checkType, displayFormat, backBufferFormat, windowed)
public static bool CheckDeviceType ( int adapter, DeviceType checkType, Format displayFormat, Format backBufferFormat, bool windowed )
public: static bool CheckDeviceType ( int adapter, DeviceType checkType, Format displayFormat, Format backBufferFormat, bool windowed )
public static boolean CheckDeviceType ( int adapter, DeviceType checkType, Format displayFormat, Format backBufferFormat, boolean windowed )
public static function CheckDeviceType ( adapter : int, checkType : DeviceType, displayFormat : Format, backBufferFormat : Format, windowed : boolean ) : boolean
- adapter
照会するディスプレイ アダプタを示す序数。AdapterListCollection.Default は、常にプライマリ ディスプレイ アダプタです。
- backBufferFormat
バック バッファ形式。形式の詳細については、Format に関する説明を参照してください。この値は、レンダリング先形式のいずれかであることが必要です。Device の DisplayMode プロパティを使用すると、現在の形式を取得できます。ウィンドウ表示のアプリケーションについては、そのハードウェアでカラー変換がサポートされていれば、バック バッファ形式が表示モード形式と一致していなくてもかまいません。バック バッファ形式に使用できるセットには制約がありますが、ランタイムで、任意の有効なバック バッファ形式をデスクトップ形式に表示できます。また、デバイスは、通常 8 ビット/ピクセルのモードでは動作しないため、デスクトップ モードで動作することが必要です。
全画面表示アプリケーションでは、カラー変換を実行できません。ウィンドウ モードに Format の Unknown を指定できます。
メソッドが正常に実行されて、デバイスがこのアダプタで使用できる場合は true。それ以外の場合は false。

HAL (Hardware Abstraction Layer) 対応の種類のデバイスではハードウェア アクセラレータが必要です。CheckDeviceType メソッドを使用して HAL デバイスをサポートできるアプリケーションがあります。
全画面表示アプリケーションでは、アルファ チャネルを含む displayFormat を指定しないでください。指定すると呼び出しが失敗します。アルファ チャネルはバック バッファには指定できますが、この 2 つの表示形式は他のすべての点では一致している必要があります。たとえば、displayFormat = X1R5G5B5 の場合、backBufferFormat の有効値には X1R5G5B5 や A1R5G5B5 などがありますが、R5G6B5 は有効ではありません。

特定の種類のデバイスがアダプタで使用できるかどうかを確認するコード例を次に示します。
Public Sub CheckDeviceType() ' Test some formats IsDeviceTypeOK(Format.X8R8G8B8, Format.A8R8G8B8) If result <> Fix(ResultCode.Success) Then System.Windows.Forms.MessageBox.Show(String.Format("The device check failed: {0}", result)) End If End Sub Public Function IsDeviceTypeOK(ByVal displayFmt As Format, ByVal backbufferFmt As Format) As Boolean Dim ai As AdapterInformation = Microsoft.WindowsMobile.DirectX.Direct3D.Manager.Adapters.Default ' Verify that the device can be used on the default adapter with the given surface format If Microsoft.WindowsMobile.DirectX.Direct3D.Manager.CheckDeviceType(ai.Adapter, DeviceType.Default, displayFmt, backbufferFmt, False) Then Return True ' if the call succeeds End If Return False ' otherwise fail. NOTE: HRESULT passed back in result End Function
public void CheckDeviceType() { // Test some formats IsDeviceTypeOK(Format.X8R8G8B8, Format.A8R8G8B8); if (result != (int)ResultCode.Success) System.Windows.Forms.MessageBox.Show(String.Format("The device check failed: {0}", result)); } public bool IsDeviceTypeOK(Format displayFmt, Format backbufferFmt) { AdapterInformation ai = Microsoft.WindowsMobile.DirectX.Direct3D.Manager.Adapters.Default; // Verify that the device can be used on the default adapter with the given surface format if (Microsoft.WindowsMobile.DirectX.Direct3D.Manager.CheckDeviceType(ai.Adapter, DeviceType.Default, displayFmt, backbufferFmt, false)) { return true; // if the call succeeds } return false; // otherwise fail. NOTE: HRESULT passed back in result }


Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からManager.CheckDeviceType メソッドを検索する場合は、下記のリンクをクリックしてください。

- Manager.CheckDeviceType メソッドのページへのリンク