> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XGameStreamingGetStreamPhysicalDimensions

> XGameStreamingGetStreamPhysicalDimensions

# XGameStreamingGetStreamPhysicalDimensions

ストリーミング クライアント上でレンダリングされる動画ストリームの物理的な寸法を取得します。

## Syntax

```cpp theme={null}
HRESULT XGameStreamingGetStreamPhysicalDimensions(
         XGameStreamingClientId client,
         uint32_t* horizontalMm,
         uint32_t* verticalMm
)
```

### Parameters

*client*   \_In\_\
型: XGameStreamingClientId

物理的サイズを照会するクライアント。

*horizontalMm*   \_Out\_\
型: uint32\_t\*

動画ストリームの水平軸のサイズ (ミリメートル単位)。

*verticalMm*   \_Out\_\
型: uint32\_t\*

動画ストリームの垂直軸のサイズ (ミリメートル単位)。

### Return value

型: HRESULT

成功した場合は **S\_OK** を返します。それ以外の場合はエラー コードを返します。

**想定されるエラー**

| エラー コード | エラー値 | エラーの理由 |
| - | - | - |
| E\_GAMESTREAMING\_NOT\_INITIALIZED | 0x89245400 | XGameStreaming ランタイムが初期化されていません。他の API を呼び出す前に [XGameStreamingInitialize](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/functions/xgamestreaminginitialize.md) を呼び出してください。 |
| E\_GAMESTREAMING\_CLIENT\_NOT\_CONNECTED | 0x89245401 | 指定されたクライアントが接続されていません。 |
| E\_GAMESTREAMING\_NO\_DATA | 0x89245402 | 要求されたデータは利用できません。データは後で利用可能になる場合があります。 |

エラー コードの一覧については、[Error Codes](https://docs.xbox.com/ja-jp/reference/errorcodes.md) を参照してください。

## Remarks

このメソッドを使用して、ストリームが小型デバイス (例: スマートフォン) に送信されるかどうかを判定できます。

これにより、デバイスのサイズに基づいて、より使いやすくデバイスに適したエクスペリエンス (たとえば、大きめのフォント サイズを使用するなど) を提示できます。

ストリームの物理的な寸法の変化にゲームが対応するようにしたい場合は、[XGameStreamingRegisterClientPropertiesChanged](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/functions/xgamestreamingregisterclientpropertieschanged.md) を通じてコールバックを登録する必要があります。

## Example

次のコード例は、`XGameStreamingGetStreamPhysicalDimensions` 関数を使用してストリーミング クライアントの最小の寸法を見つける方法を示しています。

```cpp theme={null}
void GetSmallestStreamingClient(uint32_t& widthMm, uint32_t& heightMm)
    {
        // If we don't know what the smallest client is, then search through them to find it
        if (m_smallestClient == XGameStreamingNullClientId)
        {
            for (const auto client : m_streamingClients)
            {
                if (client.clientId != XGameStreamingNullClientId)
                {
                    uint32_t clientWidthMm = 0;
                    uint32_t clientHeightMm = 0;
                    if (SUCCEEDED(XGameStreamingGetStreamPhysicalDimensions(client.clientId, &clientWidthMm, &clientHeightMm)))
                    {
                        if (clientWidthMm < m_smallestClientWidthMm)
                        {
                            m_smallestClientWidthMm = clientWidthMm;
                            m_smallestClientHeightMm = clientHeightMm;
                        }
                    }
                }
            }
        }

        widthMm = m_smallestClientWidthMm;
        heightMm = m_smallestClientHeightMm;
    }
```

## Requirements

**ヘッダー:** xgamestreaming.h

**ライブラリ:** xgameruntimelib

**サポートされているプラットフォーム:** Windows、XBOX One ファミリー本体および XBOX Series 本体

## See also

[XGameStreaming](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/xgamestreaming_members.md)\
[XGameStreamingRegisterClientPropertiesChanged](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/functions/xgamestreamingregisterclientpropertieschanged.md)\
[XGameStreaming](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/xgamestreaming_members.md#ClientProperties)


## Related topics

- [XBOX Game Streaming の開発のベスト プラクティス](https://docs.xbox.com/ja-jp/build/core-features/common/game-streaming/game-streaming-optimizing-your-game.md)
- [XGameStreamingClientProperty](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/enums/xgamestreamingclientproperty.md)
- [XBOX Accessibility Guideline 101](https://docs.xbox.com/ja-jp/build/game-principles/accessibility/xag-deep-dives/xag-101-text-display.md)
- [XGameStreaming (API の内容)](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/xgamestreaming_members.md)
- [XGameStreamingGetStreamAddedLatency](https://docs.xbox.com/ja-jp/reference/system/xgamestreaming/functions/xgamestreaminggetstreamaddedlatency.md)
