Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
D2D1_COMPOSITE_MODE enumeration (d2d1_1.h)
Used to specify the blend mode for all of the Direct2D blending operations.
Syntax
typedef enum D2D1_COMPOSITE_MODE {
D2D1_COMPOSITE_MODE_SOURCE_OVER = 0,
D2D1_COMPOSITE_MODE_DESTINATION_OVER = 1,
D2D1_COMPOSITE_MODE_SOURCE_IN = 2,
D2D1_COMPOSITE_MODE_DESTINATION_IN = 3,
D2D1_COMPOSITE_MODE_SOURCE_OUT = 4,
D2D1_COMPOSITE_MODE_DESTINATION_OUT = 5,
D2D1_COMPOSITE_MODE_SOURCE_ATOP = 6,
D2D1_COMPOSITE_MODE_DESTINATION_ATOP = 7,
D2D1_COMPOSITE_MODE_XOR = 8,
D2D1_COMPOSITE_MODE_PLUS = 9,
D2D1_COMPOSITE_MODE_SOURCE_COPY = 10,
D2D1_COMPOSITE_MODE_BOUNDED_SOURCE_COPY = 11,
D2D1_COMPOSITE_MODE_MASK_INVERT = 12,
D2D1_COMPOSITE_MODE_FORCE_DWORD = 0xffffffff
} ;
Constants
D2D1_COMPOSITE_MODE_SOURCE_OVERValue: 0 The standard source-over-destination blend mode. |
D2D1_COMPOSITE_MODE_DESTINATION_OVERValue: 1 The destination is rendered over the source. |
D2D1_COMPOSITE_MODE_SOURCE_INValue: 2 Performs a logical clip of the source pixels against the destination pixels. |
D2D1_COMPOSITE_MODE_DESTINATION_INValue: 3 The inverse of the D2D1_COMPOSITE_MODE_SOURCE_IN operation. |
D2D1_COMPOSITE_MODE_SOURCE_OUTValue: 4 This is the logical inverse to D2D1_COMPOSITE_MODE_SOURCE_IN. |
D2D1_COMPOSITE_MODE_DESTINATION_OUTValue: 5 The is the logical inverse to D2D1_COMPOSITE_MODE_DESTINATION_IN. |
D2D1_COMPOSITE_MODE_SOURCE_ATOPValue: 6 Writes the source pixels over the destination where there are destination pixels. |
D2D1_COMPOSITE_MODE_DESTINATION_ATOPValue: 7 The logical inverse of D2D1_COMPOSITE_MODE_SOURCE_ATOP. |
D2D1_COMPOSITE_MODE_XORValue: 8 The source is inverted with the destination. |
D2D1_COMPOSITE_MODE_PLUSValue: 9 The channel components are summed. |
D2D1_COMPOSITE_MODE_SOURCE_COPYValue: 10 The source is copied to the destination; the destination pixels are ignored. |
D2D1_COMPOSITE_MODE_BOUNDED_SOURCE_COPYValue: 11 Equivalent to D2D1_COMPOSITE_MODE_SOURCE_COPY, but pixels outside of the source bounds are unchanged. |
D2D1_COMPOSITE_MODE_MASK_INVERTValue: 12 Destination colors are inverted according to a source mask. |
D2D1_COMPOSITE_MODE_FORCE_DWORDValue: 0xffffffff |
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
| Requirement | Value |
|---|---|
| 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
Feedback
Was this page helpful?
