Method CreateFormatConvertedBitmap
- Namespace
- PaintDotNet.Imaging
- Assembly
- PaintDotNet.Windows.dll
CreateFormatConvertedBitmap(IBitmapSource, in PixelFormat, BitmapDitherType, IPalette?, double, BitmapPaletteType)
Converts a bitmap from one pixel format to another, handling dithering and halftoning to indexed formats, palette translation, and alpha thresholding.
For more information, see IWICFormatConverter::Initialize.
IBitmapSource CreateFormatConvertedBitmap(IBitmapSource source, in PixelFormat dstFormat, BitmapDitherType dither, IPalette? palette, double alphaThresholdPercent, BitmapPaletteType paletteTranslate)
Parameters
sourceIBitmapSourceThe input bitmap to convert.
dstFormatPixelFormatThe destination pixel format.
ditherBitmapDitherTypeThe dithering type used for conversion. Applicable only for indexed destination formats such as Indexed8.
paletteIPaletteThe palette to use for conversion. Should be
nullif not using an indexed destination format such as Indexed8.alphaThresholdPercentdoubleThe alpha threshold to use for conversion. Specifies the percentage of transparency that should map to the transparent color of the palette. Applicable only for indexed destination formats such as Indexed8.
paletteTranslateBitmapPaletteTypeThe palette translation type to use for conversion. Applicable only for indexed destination formats such as Indexed8.