Table of Contents

Method LoadFileAsBitmapBgra32

Namespace
PaintDotNet.FileTypes
Assembly
PaintDotNet.FileTypes.dll

LoadFileAsBitmapBgra32(IFileTypesService1, string, IColorContext?)

Loads the image from the given file path, then converts it to BGRA32 while optionally using a specific IColorContext for the conversion.

public static IFileTypeBitmapSource<ColorBgra32> LoadFileAsBitmapBgra32(this IFileTypesService1 service, string filePath, IColorContext? targetColorContext = null)

Parameters

service IFileTypesService1

The service to use for finding and creating IFileType instances.The path of the file to load from.The target color context. If null then the default color context for TPixel will be used (usually sRGB).

filePath string

The service to use for finding and creating IFileType instances.The path of the file to load from.The target color context. If null then the default color context for TPixel will be used (usually sRGB).

targetColorContext IColorContext

The service to use for finding and creating IFileType instances.The path of the file to load from.The target color context. If null then the default color context for TPixel will be used (usually sRGB).

Returns

IFileTypeBitmapSource<ColorBgra32>

The bitmap source. Use the ToBitmap() extension method to convert to an IBitmap.