Method LoadFileAsDocument
- Namespace
- PaintDotNet.FileTypes
- Assembly
- PaintDotNet.FileTypes.dll
LoadFileAsDocument(IFileTypesService1, string)
Loads an IFileTypeDocument from the given file path.
public static IFileTypeDocument LoadFileAsDocument(this IFileTypesService1 service, string filePath)
Parameters
serviceIFileTypesService1The service to use for finding and creating IFileType instances.
filePathstringThe path of the file to load from.
Returns
- IFileTypeDocument
A IFileTypeDocument with its layers, metadata, color context, etc.
Remarks
This method may also throw exceptions for I/O errors, including FileNotFoundException, as well as any exceptions that the FileType itself may throw. This method may return a document in a non-RGB pixel format, such as ColorCmyk32, depending on the image's contents and the FileType's implementation.
Exceptions
- ArgumentException
filePathdoes not have an extension.- KeyNotFoundException
A FileType that handles the file's extension could not be found.