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

# GetResourceSeekOffset

> 取得紋理之資料流資料的搜尋位移。

取得紋理之資料流資料的搜尋位移。

<a id="syntaxSection" />

## 語法

```cpp theme={null}
int64_t GetResourceSeekOffset(  
         uint32_t ResourceIdx  
)  
```

<a id="parametersSection" />

### 參數

*ResourceIdx*\
類型: uint32\_t

紋理以零為起始的索引。

<a id="retvalSection" />

### 傳回值

類型: int64\_t

如果成功，則為指定紋理之資料流資料從檔案開頭算起的搜尋位移值 (以位元組為單位)；否則傳回 -1。

<a id="remarksSection" />

## 備註

此方法會傳回指定紋理之資料流資料從 XBTC 封存開頭算起的搜尋位移值。搜尋位移值一律是 16 位元組的倍數，因為解壓縮硬體要求搜尋位移必須對齊 16 位元組界限。如果 `ResourceIdx` 設定為封存中某個紋理的索引，此方法會傳回封存之 [XBTC\_ARCHIVE\_HEADER](/zh-TW/reference/graphics/xbtc/structs/xbtc_archive_header) 結構的 `DataOffset` 值與指定紋理之 [XBTC\_OFFSET\_AND\_INDEX](/zh-TW/reference/graphics/xbtc/structs/xbtc_offset_and_index) 結構的 `BaseOffset` 值之總和。如果 `ResourceIdx` 設定為等於或大於封存中紋理數目的值，此方法會傳回 -1。如需 XBTC 封存內容與結構的詳細資訊，請參閱 [XBOX Texture Compressor (XBTC) 封存檔案規格](https://learn.microsoft.com/en-us/gaming/gdk/_content/gc/graphics/newfeatures/xbtc/xbtc-archive-format)。

<a id="requirementsSection" />

## 需求

**標頭:** XBTC.h

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

<a id="seealsoSection" />

## 另請參閱

[GetTextureOffset](/zh-TW/reference/graphics/xbtc/interfaces/XBTCArchiveReader/methods/xbtcarchivereader_gettextureoffset)\
[XBTCArchiveReader](/zh-TW/reference/graphics/xbtc/interfaces/XBTCArchiveReader/xbtcarchivereader)\
[XBTC](/zh-TW/reference/graphics/xbtc/xbtc_members)


## Related topics

- [NDA topic directory - live Microsoft Learn links](/nda/nda-topic-directory.md)
- [GetXmaBlockContainingSample](/reference/audio/xma2defs/functions/getxmablockcontainingsample.md)
- [GetXmaDecodePositionForSample](/reference/audio/xma2defs/functions/getxmadecodepositionforsample.md)
- [CreatePlacedResource](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createplacedresource_public.md)
- [XMA2Defs](/reference/audio/xma2defs/xma2defs_members.md)
