SaveToWICFile (const Image&, DWORD, REFGUID, LPCWSTR, const GUID, std::function<void(IPropertyBag2)>)

Saves one or more images in memory buffers to a .WIC file.

Syntax

HRESULT SaveToWICFile(
         const Image &image,
         DWORD flags,
         REFGUID guidContainerFormat,
         LPCWSTR szFile,
         const GUID *targetFormat,
         std::function<void(IPropertyBag2*)> setCustomProps = nullptr
)  

Parameters

image
Type: Image 

[in] Pointer to a single Image structure in a memory buffer.

flags
Type: DWORD 

[in] One or more flags from the DDS_FLAGS enumeration.

guidContainerFormat
Type: REFGUID 

[in] GUID of the container format. See GetWICCodec.

szFile
Type: LPCWSTR 

[in] Source file.

targetFormat
Type: GUID *

[in, optional] The WIC pixel format, as a GUID. If the specified WIC pixel format is not supported by the WIC codec, E_FAIL is returned.

setCustomProps
Type: std::function<void(IPropertyBag2*)> 

[in, optional] Any custom properties for the image, as a function that returns void and takes a pointer to an IPropertyBag2.

Return value

Type: HRESULT 

Success or error code.

Requirements

Header: Declared in directxtex.h.