> ## 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.

# D3D12_VIEWPORT

> 描述檢視區的維度。

描述檢視區的維度。

## 語法

```cpp theme={null}
typedef struct D3D12_VIEWPORT
{
    FLOAT TopLeftX;
    FLOAT TopLeftY;
    FLOAT Width;
    FLOAT Height;
    FLOAT MinDepth;
    FLOAT MaxDepth;
} D3D12_VIEWPORT
```

### 成員

*TopLeftX*\
類型：FLOAT

檢視區左側的 X 位置。

*TopLeftY*\
類型：FLOAT

檢視區頂端的 Y 位置。

*Width*\
類型：FLOAT

檢視區的寬度。

*Height*\
類型：FLOAT

檢視區的高度。

*MinDepth*\
類型：FLOAT

檢視區的最小深度。範圍介於 0 與 1 之間。

*MaxDepth*\
類型：FLOAT

檢視區的最大深度。範圍介於 0 與 1 之間。

## 備註

在呼叫 [ID3D12GraphicsCommandList::RSSetViewports](/zh-TW/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_rssetviewports_public) 時，將這些結構的陣列傳遞至 <i>pViewports</i> 參數，以設定顯示的檢視區。

## 需求

**標頭:** d3d12\_xs.h 或 d3d12\_x.h\
**程式庫:** d3d12\_xs.lib 或 d3d12\_x.lib\
**支援的平台**: XBOX Series 主機與 XBOX One 系列

## 另請參閱

[核心結構](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/direct3d-12-structures)


## Related topics

- [D3D12_FEATURE_DATA_D3D12_OPTIONS13](/zh-TW/reference/graphics/d3d12/structs/d3d12_feature_data_d3d12_options13_public.md)
- [D3D12_FEATURE_DATA_D3D12_OPTIONS6](/zh-TW/reference/graphics/d3d12/structs/d3d12_feature_data_d3d12_options6_public.md)
- [D3D12_VIEW_INSTANCE_LOCATION](/zh-TW/reference/graphics/d3d12/structs/d3d12_view_instance_location_public.md)
- [D3D12_VIEW_INSTANCING_DESC](/zh-TW/reference/graphics/d3d12/structs/d3d12_view_instancing_desc_public.md)
- [D3D12_GRAPHICS_STATES](/zh-TW/reference/graphics/d3d12/enums/d3d12_graphics_states_public.md)
