IWICDdsFrameDecode::CopyBlocks method

Requests pixel data as it is natively stored within the DDS file.

Syntax


HRESULT CopyBlocks(
  [in, unique]  const WICRect *prcBoundsInBlocks,
  [in]          UINT cbStride,
  [in]          UINT cbBufferSize,
  [out]         BYTE *pbBuffer
);

Parameters

prcBoundsInBlocks [in]

Type: const WICRect*

The rectangle to copy from the source. A NULL value specifies the entire texture.

If the texture uses a block-compressed DXGI_FORMAT, all values of the rectangle are expressed in number of blocks, not pixels.

cbStride [in]

Type: UINT

The stride, in bytes, of the destination buffer. This represents the number of bytes from the buffer pointer to the next row of data. If the texture uses a block-compressed DXGI_FORMAT, a "row of data" is defined as a row of blocks which contains multiple pixel scanlines.

cbBufferSize [in]

Type: UINT

The size, in bytes, of the destination buffer.

pbBuffer [out]

Type: BYTE*

A pointer to the destination buffer.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

If the texture does not use a block-compressed DXGI_FORMAT, this method behaves similarly to IWICBitmapSource::CopyPixels. However, it does not perform any pixel format conversion, and instead produces the raw data from the DDS file.

If the texture uses a block-compressed DXGI_FORMAT, this method copies the block data directly into the provided buffer. In this case, the prcBoundsInBlocks parameter is defined in blocks, not pixels. To determine if this is the case, call GetFormatInfo and read the DxgiFormat member of the returned WICDdsFormatInfo structure.

Requirements

Minimum supported client

Windows 8.1 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 R2 [desktop apps | Windows Store apps]

Header

Wincodec.h

IDL

Wincodec.idl

Library

Windowscodecs.lib

DLL

Windowscodecs.dll

See also

IWICDdsFrameDecode
IWICBitmapSource::CopyPixels

 

 

Community Additions

ADD
Show:
© 2014 Microsoft