D1154: Invalid Bitmap Input Format

This operation is not compatible with the pixel format of the bitmap.

 

Possible Causes

Direct2D supports alpha-only surface formats such as DXGI_FORMAT_A8_UNORM, but they may only be used as opacity brushes or for masking. If an application creates a bitmap brush whose bitmap has an alpha-only format, it should not attempt to use the brush with operations which require a color brush. ID2D1RenderTarget::DrawLine and ID2D1RenderTarget::FillRectangle, for example, use a color brush.

Possible Fixes

To address this message, ensure bitmaps with alpha-only formats are only used for opacity brushes or masking. If a bitmap should contain color information, create it using a surface format which includes color channels.