Interface IFileTypeDocument<TPixel>
- Namespace
- PaintDotNet.FileTypes
- Assembly
- PaintDotNet.FileTypes.dll
Represents a mutable document (image) that consists of metadata and layers.
public interface IFileTypeDocument<TPixel> : IFileTypeDocument, IReadOnlyFileTypeDocument<TPixel>, IReadOnlyFileTypeDocument, IObjectRef, IIsDisposed, IDisposable, IInternalImpl where TPixel : unmanaged, INaturalPixelInfo
Type Parameters
TPixel
- 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
- Layers
Gets the top-level layers list of the document.
Methods
- CreateBitmapLayer()
Creates a new bitmap layer. The returned layer is not added to the document's layer list. You must call the
Addmethod on the Layers property to add the layer to the document.