D2D1_COMPOSITE_MODE Enumeration

Used to specify the blend mode for all of the Direct2D blending operations.

Syntax

typedef enum D2D1_COMPOSITE_MODE {
  D2D1_COMPOSITE_MODE_SOURCE_OVER,
  D2D1_COMPOSITE_MODE_DESTINATION_OVER,
  D2D1_COMPOSITE_MODE_SOURCE_IN,
  D2D1_COMPOSITE_MODE_DESTINATION_IN,
  D2D1_COMPOSITE_MODE_SOURCE_OUT,
  D2D1_COMPOSITE_MODE_DESTINATION_OUT,
  D2D1_COMPOSITE_MODE_SOURCE_ATOP,
  D2D1_COMPOSITE_MODE_DESTINATION_ATOP,
  D2D1_COMPOSITE_MODE_XOR,
  D2D1_COMPOSITE_MODE_PLUS,
  D2D1_COMPOSITE_MODE_SOURCE_COPY,
  D2D1_COMPOSITE_MODE_BOUNDED_SOURCE_COPY,
  D2D1_COMPOSITE_MODE_MASK_INVERT,
  D2D1_COMPOSITE_MODE_FORCE_DWORD
} ;

Constants

D2D1_COMPOSITE_MODE_SOURCE_OVER The standard source-over-destination blend mode.
D2D1_COMPOSITE_MODE_DESTINATION_OVER The destination is rendered over the source.
D2D1_COMPOSITE_MODE_SOURCE_IN Performs a logical clip of the source pixels against the destination pixels.
D2D1_COMPOSITE_MODE_DESTINATION_IN The inverse of the D2D1_COMPOSITE_MODE_SOURCE_IN operation.
D2D1_COMPOSITE_MODE_SOURCE_OUT This is the logical inverse to D2D1_COMPOSITE_MODE_SOURCE_IN.
D2D1_COMPOSITE_MODE_DESTINATION_OUT The is the logical inverse to D2D1_COMPOSITE_MODE_DESTINATION_IN.
D2D1_COMPOSITE_MODE_SOURCE_ATOP Writes the source pixels over the destination where there are destination pixels.
D2D1_COMPOSITE_MODE_DESTINATION_ATOP The logical inverse of D2D1_COMPOSITE_MODE_SOURCE_ATOP.
D2D1_COMPOSITE_MODE_XOR The source is inverted with the destination.
D2D1_COMPOSITE_MODE_PLUS The channel components are summed.
D2D1_COMPOSITE_MODE_SOURCE_COPY The source is copied to the destination; the destination pixels are ignored.
D2D1_COMPOSITE_MODE_BOUNDED_SOURCE_COPY Equivalent to D2D1_COMPOSITE_MODE_SOURCE_COPY, but pixels outside of the source bounds are unchanged.
D2D1_COMPOSITE_MODE_MASK_INVERT Destination colors are inverted according to a source mask.
D2D1_COMPOSITE_MODE_FORCE_DWORD

Remarks

The figure here shows an example of each of the modes with images that have an opacity of 1.0 or 0.5.

An example image of each of the modes with opacity set to 1.0 or 0.5.

There can be slightly different interpretations of these enumeration values depending on where the value is used.

  • With a composite effect:

    D2D1_COMPOSITE_MODE_DESTINATION_COPY is equivalent to D2D1_COMPOSITE_MODE_SOURCE_COPY with the inputs inverted.

  • As a parameter to ID2D1DeviceContext::DrawImage: D2D1_COMPOSITE_MODE_DESTINATION_COPY is a no-op since the destination is already in the selected target.

Sample code

For an example that uses composite modes, download the Direct2D composite effect modes sample.

Requirements

   
Minimum supported client Windows 8 and Platform Update for Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | UWP apps]
Header d2d1_1.h

See Also

ID2D1DeviceContext::DrawImage