Table of Contents

Interface IFileTypeDocument

Namespace
PaintDotNet.FileTypes
Assembly
PaintDotNet.FileTypes.dll

Represents a mutable document (image) that consists of metadata and layers.

public interface IFileTypeDocument : 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

Layers

Gets the top-level layers list of the document.

Metadata

Gets the metadata stored in the document.

Resolution

Gets or sets the resolution of the document, in either dots-per-inch (DPI) or dots-per-centimeter (DPCM).

Methods

CreateBitmapLayer()

Creates a new bitmap layer. The returned layer is not added to the document's layer list. You must call the Add method on the Layers property to add the layer to the document.

SetColorContext(IColorContext)

Sets the color context for the document, which defines its color space.