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

# XBTCCompressStreamAlloc

> 從未壓縮串流建立壓縮串流，並為其配置紋理容器。

從未壓縮串流建立壓縮串流，並為其配置紋理容器。

## 語法

```cpp theme={null}
HRESULT XBTCCompressStreamAlloc(  
         size_t* pCompressedSize,  
         size_t* pInflatedSize,  
         void** ppCompressedStream,  
         const void* pUncompressedStream,  
         size_t UncompressedSize,  
         DXGI_FORMAT Format,  
         XBTC_COMPRESSION_FLAGS Flags  
)  
```

### 參數

*pCompressedSize*   \_Out\_\
類型：size\_t\*

壓縮後的結果大小。

*pInflatedSize*   \_Out\_\
類型：size\_t\*

串流在 Deflate() 之前的大小。

*ppCompressedStream*   \_Out\_\
類型：void\*\*

指向壓縮串流的指標。

*pUncompressedStream*   \_In\_reads\_bytes\_(UncompressedSize)\
類型：void\*

指向未壓縮串流的指標。

*UncompressedSize*   \_In\_\
類型：size\_t

未壓縮串流的大小 (以位元組為單位)。

*Format*   \_In\_\
類型：DXGI\_FORMAT

紋理格式 (用於 BCPack)。

*Flags*   \_In\_\
類型：[XBTC\_COMPRESSION\_FLAGS](/zh-TW/reference/graphics/xbtc/enums/xbtc_compression_flags)

壓縮選項。

### 傳回值

類型：HRESULT

如果串流無法壓縮，則傳回 E\_FAIL。

## 備註

`XBTCCompressStreamAlloc` 會壓縮單一紋理串流。使用完壓縮串流後，請呼叫 [XBTCFreeCompressedStream](/zh-TW/reference/graphics/xbtc/functions/xbtcfreecompressedstream) 以釋放配置的資源。
您必須提供至少與 *UncompressedSize* 一樣大的目的地緩衝區。\
如需壓縮設定的詳細資訊，請參閱 [XBTC\_COMPRESSION\_FLAGS](/zh-TW/reference/graphics/xbtc/enums/xbtc_compression_flags)。\
如需 XBTC 封存的詳細資訊，請參閱 [XBOX Texture Compressor (XBTC)](https://learn.microsoft.com/en-us/gaming/gdk/_content/gc/graphics/newfeatures/xbtc/xbox-texture-compressor)。\
如需 XBTC 成員的詳細資訊，請參閱 [XBTC](/zh-TW/reference/graphics/xbtc/xbtc_members)。

## 需求

**標頭:** XBTC.h

**支援的平台**: XBOX One 系列主機與 XBOX Series 主機

## 另請參閱

[XBTC](/zh-TW/reference/graphics/xbtc/xbtc_members)


## Related topics

- [NDA topic directory - live Microsoft Learn links](/nda/nda-topic-directory.md)
- [Game streaming latency measurement](/build/core-features/common/game-streaming/game-streaming-latency-measurement.md)
- [Make package (makepkg.exe)](/build/core-features/common/packaging/deployment/makepkg.md)
- [ApuAlloc](/reference/audio/apu/functions/apualloc.md)
- [Overview of a single stream Convolution using the XDSP API](/build/console-features/audio/overviews/xdsp-overview-single-stream-convolution.md)
