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

Saves one image in memory buffers to a .WIC WIC-supported bitmap file.

Syntax

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

Parameters

image
Type: Image 

[in] Pointer to a single Image structure.

flags
Type: DWORD 

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

guidContainerFormat
Type: REFGUID 

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

blob
Type: Blob 

[out] Pointer to a Blob class instance.

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.