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
serviceIFileTypesService1The service to use for finding and creating IFileType instances.The path of the file to load from.The target color context. If
nullthen the default color context forTPixelwill be used (usually sRGB).filePathstringThe service to use for finding and creating IFileType instances.The path of the file to load from.The target color context. If
nullthen the default color context forTPixelwill be used (usually sRGB).targetColorContextIColorContextThe service to use for finding and creating IFileType instances.The path of the file to load from.The target color context. If
nullthen the default color context forTPixelwill be used (usually sRGB).
Returns
- IFileTypeBitmapSource<ColorBgra32>
The bitmap source. Use the
ToBitmap()extension method to convert to an IBitmap.