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

# XGameStreamingGetStreamPhysicalDimensions

> XGameStreamingGetStreamPhysicalDimensions

# XGameStreamingGetStreamPhysicalDimensions

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

<a id="syntaxSection" />

## Syntax

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

<a id="parametersSection" />

### Parameters

*client*   \_In\_\
型: XGameStreamingClientId

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

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

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

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

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

<a id="retvalSection" />

### Return value

型: HRESULT

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

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

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

エラー コードの一覧については、[Error Codes](/reference/errorcodes) を参照してください。

<a id="remarksSection" />

## Remarks

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

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

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

<a id="exampleSection" />

## 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;
    }
```

<a id="requirementsSection" />

## Requirements

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

**ライブラリ:** xgameruntimelib

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

<a id="seealsoSection" />

## See also

[XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members)\
[XGameStreamingRegisterClientPropertiesChanged](/reference/system/xgamestreaming/functions/xgamestreamingregisterclientpropertieschanged)\
[XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members#ClientProperties)


## Related topics

- [XBOX Game Streaming 向けにゲームを最適化する](/ja-jp/build/core-features/common/game-streaming/game-streaming-optimizing-your-game.md)
- [XGameStreamingClientProperty](/ja-jp/reference/system/xgamestreaming/enums/xgamestreamingclientproperty.md)
- [XAG 101: テキスト表示](/ja-jp/build/game-principles/accessibility/xag-deep-dives/xag-101-text-display.md)
- [XGameStreaming](/ja-jp/reference/system/xgamestreaming/xgamestreaming_members.md)
- [XGameStreamingGetStreamAddedLatency](/ja-jp/reference/system/xgamestreaming/functions/xgamestreaminggetstreamaddedlatency.md)
