Table of Contents

Method CreatePremultipliedAdapter

Namespace
PaintDotNet.Imaging
Assembly
PaintDotNet.Windows.Framework.dll

CreatePremultipliedAdapter(IBitmap<ColorBgra32>, PremultipliedAdapterOptions)

Creates an adapter that reinterprets a bitmap in a straight alpha pixel format over to a premultiplied alpha pixel format, such as from ColorBgra32 to ColorPbgra32.
The adapter can then be used for Direct2D rendering, such as with CreateBitmapDeviceContext(IBitmap, in DeviceContextProperties).
A copy is not made; the adapter references the same memory as the original bitmap.
Optionally supports conversion to premultiplied alpha on creation, and conversion back to straight alpha on disposal.

public static IBitmap<ColorPbgra32> CreatePremultipliedAdapter(this IBitmap<ColorBgra32> bitmap, PremultipliedAdapterOptions options)

Parameters

bitmap IBitmap<ColorBgra32>
options PremultipliedAdapterOptions

Returns

IBitmap<ColorPbgra32>