Interface IReadOnlyFileTypeDocument
- Namespace
- PaintDotNet.FileTypes
- Assembly
- PaintDotNet.FileTypes.dll
Represents a read-only document (image) that consists of metadata and layers.
public interface IReadOnlyFileTypeDocument : IObjectRef, IIsDisposed, IDisposable, IInternalImpl
- Inherited Members
- Extension Methods
Remarks
The IReadOnlyFileTypeDocument and IFileTypeDocument interfaces support pixel format speciation.
For example, if the pixel format is Bgra32, then you can use the CreateRef
extension method to obtain a strongly-typed IReadOnlyFileTypeDocument<TPixel> or
IFileTypeDocument<TPixel> with TPixel set to ColorBgra32:
IReadOnlyFileTypeDocument document = GetDocument();
if (document.PixelFormat == PixelFormats.Bgra32)
{
IReadOnlyFileTypeDocument<ColorBgra32> docBgra32 = document.CreateRef<IReadOnlyFileTypeDocument<ColorBgra32>>();
....
}
This allows you to work with the pixel data in a type-safe manner.
Properties
- Factory
Gets the factory that was used to create this document, and which can be used to create other objects necessary for working with documents and metadata.
- Layers
Gets the top-level layers list of the document.
- Metadata
Gets the metadata stored in the document.
- PixelFormat
Gets the pixel format of the document.
- Resolution
Gets the resolution of the document, in either dots-per-inch (DPI) or dots-per-centimeter (DPCM).
- Size
Gets the size, in pixels, of the document.
Methods
- GetColorContext()
Gets the color context that defines the color space of the document. If the document has a color profile defined in its metadata then this will provide access to that. A document always has a color context.
- GetCompositeBitmap(in PixelFormat)
Gets a bitmap source that renders the flattened (composite) image of all visible layers.