Export (0) Print
Expand All

D2D1_COMPOSITE_MODE enumeration

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

Syntax


typedef enum  { 
  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;

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.

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 | Windows Store apps]

Minimum supported server

Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Header

D2d1_1.h

See also

ID2D1DeviceContext::DrawImage

 

 

Community Additions

ADD
Show:
© 2014 Microsoft