PremultiplyAlpha (const Image&, ScratchImage&)

Converts an image assuming the original is not using premultiplied alpha into a premultiplied alpha version of the same image.

Syntax

HRESULT PremultiplyAlpha(
         const Image &srcImage,
         ScratchImage &image
)  

Parameters

srcImage
Type: Image 

[in] Pointer to one or more Image structures in a memory buffer.

image
Type: ScratchImage 

[out] Pointer to a ScratchImage class instance.

Return value

Type: HRESULT 

Success or error code.

Remarks

This function does not operate directly on block compressed images. See Decompress and Compress.

This function is most useful for working with rendering that relies on premultiplied alpha blending (see DirectXTK).

CodePlex shows an example and blog links.

Requirements

Header: Declared in directxtex.h.