# GpCompositingMode enumeration
{: .no_toc }

Selects how a drawn colour is combined with the colour already on the surface.

The setting is the **CompositingMode** property of [**Graphics**](/twinBASIC-docs/tB/Packages/Contributed/GdiPlus/Graphics.md). It matters only for colours that are not fully opaque.

> [!NOTE] timeless
> Text drawn with ClearType cannot be combined with **CompositingModeSourceCopy**: **DrawString** returns **InvalidParameter** and draws nothing. That is the hint [**TextRenderingHintClearTypeGridFit**](/twinBASIC-docs/tB/Packages/Contributed/GdiPlus/Enumerations/GpTextRenderingHint.md) and, when Windows smooths fonts with ClearType, which is its default setting, also [**TextRenderingHintSystemDefault**](/twinBASIC-docs/tB/Packages/Contributed/GdiPlus/Enumerations/GpTextRenderingHint.md). The other four hints draw. This is a limit of GDI+.

| Member | Value | Description |
|:-------|:------|:------------|
| **CompositingModeSourceOver**{: #CompositingModeSourceOver } | `0` | The drawn colour is blended with the background according to its alpha value. |
| **CompositingModeSourceCopy**{: #CompositingModeSourceCopy } | `1` | The drawn colour replaces the background colour, alpha value included. |

## Used by

- [**Graphics**](/twinBASIC-docs/tB/Packages/Contributed/GdiPlus/Graphics.md) class: [**CompositingMode**](/twinBASIC-docs/tB/Packages/Contributed/GdiPlus/Graphics.md#compositingmode)

## See Also

- [CompositingMode](https://learn.microsoft.com/en-us/windows/win32/api/gdiplusenums/ne-gdiplusenums-compositingmode) -- Microsoft's documentation of the GDI+ enumeration
- [Enumerations](/twinBASIC-docs/tB/Packages/Contributed/GdiPlus/Enumerations/index.md) -- all the enumerations of the package
- [Graphics](/twinBASIC-docs/tB/Packages/Contributed/GdiPlus/Graphics.md) class
