Table of Contents

Class ImageDocument

Namespace
OdfKit.Image
Assembly
OdfKit.dll

Represents a high-level ODF image document. 表示高階 ODF 影像文件(Image Document)的類別。

public class ImageDocument : OdfImageDocument, IDisposable, IAsyncDisposable
Inheritance
ImageDocument
Implements
Inherited Members

Constructors

ImageDocument(OdfPackage)

Initializes a new instance of the ImageDocument class with the specified ODF package. 使用指定的 ODF 封裝初始化 ImageDocument 類別的新執行個體。

public ImageDocument(OdfPackage package)

Parameters

package OdfPackage

The ODF package instance. / ODF 封裝執行個體。

Methods

Create()

Creates a new high-level ODI image document. 建立新的高階 ODI 影像文件。

public static ImageDocument Create()

Returns

ImageDocument

A new ImageDocument instance. / 新的 ImageDocument 執行個體。

CreateFromFlatDocument(FlatImageDocument)

Creates an equivalent ODI (ZIP package) image document from a FODI flat XML image document, with identical content. 從 FODI 扁平 XML 影像文件建立等價的 ODI(ZIP 封裝)影像文件,內容完全相同。

public static ImageDocument CreateFromFlatDocument(FlatImageDocument document)

Parameters

document FlatImageDocument

The source FODI flat XML image document. / 來源 FODI 扁平 XML 影像文件。

Returns

ImageDocument

The created ImageDocument instance. / 建立完成的 ImageDocument 執行個體。

CreateFromTemplate(ImageTemplateDocument)

Creates a new high-level ODI image document from the specified image template document. 從指定的影像範本文件建立新的高階 ODI 影像文件。

public static ImageDocument CreateFromTemplate(ImageTemplateDocument template)

Parameters

template ImageTemplateDocument

The image template document. / 影像範本文件。

Returns

ImageDocument

The created ImageDocument instance. / 建立完成的 ImageDocument 執行個體。

Load(Stream)

Loads a high-level ODI image document from the specified stream. 從指定資料流載入高階 ODI 影像文件。

public static ImageDocument Load(Stream stream)

Parameters

stream Stream

Returns

ImageDocument

The loaded ImageDocument instance. / 載入完成的 ImageDocument 執行個體。

Load(Stream, string?)

Full overload of Load that accepts stream and fileName. Load 完整多載:接受 stream 與 fileName。

public static ImageDocument Load(Stream stream, string? fileName)

Parameters

stream Stream
fileName string

Returns

ImageDocument

Load(string)

Loads a high-level ODI image document from the specified path. 從指定路徑載入高階 ODI 影像文件。

public static ImageDocument Load(string path)

Parameters

path string

The ODI document path. / ODI 文件路徑。

Returns

ImageDocument

The loaded ImageDocument instance. / 載入完成的 ImageDocument 執行個體。

LoadAsync(Stream)

Asynchronously loads a high-level ODI image document from the specified stream. 非同步從指定資料流載入高階 ODI 影像文件。

public static Task<ImageDocument> LoadAsync(Stream stream)

Parameters

stream Stream

Returns

Task<ImageDocument>

A task representing the asynchronous load operation, whose result is the loaded ImageDocument. / 代表非同步載入作業的工作,其結果為載入完成的 ImageDocument

LoadAsync(Stream, string?)

Short overload of LoadAsync that accepts stream and fileName; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 stream 與 fileName;其餘可選參數使用預設值並轉呼叫最長 LoadAsync 多載。

public static Task<ImageDocument> LoadAsync(Stream stream, string? fileName)

Parameters

stream Stream
fileName string

Returns

Task<ImageDocument>

LoadAsync(Stream, string?, CancellationToken)

Short overload of LoadAsync that accepts stream, fileName, and cancellationToken; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 stream、fileName 與 cancellationToken;其餘可選參數使用預設值並轉呼叫最長 LoadAsync 多載。

public static Task<ImageDocument> LoadAsync(Stream stream, string? fileName, CancellationToken cancellationToken)

Parameters

stream Stream
fileName string
cancellationToken CancellationToken

Returns

Task<ImageDocument>

LoadAsync(Stream, CancellationToken)

Asynchronously loads the document from a stream with a cancellation token. 以取消語彙基元非同步從資料流載入文件。

public static Task<ImageDocument> LoadAsync(Stream stream, CancellationToken cancellationToken)

Parameters

stream Stream

The document stream. / 文件資料流。

cancellationToken CancellationToken

The cancellation token. / 取消語彙基元。

Returns

Task<ImageDocument>

A task whose result is the loaded document. / 代表非同步載入作業的工作,其結果為載入完成的文件。

LoadAsync(string)

Asynchronously loads a high-level ODI image document from the specified path. 非同步從指定路徑載入高階 ODI 影像文件。

public static Task<ImageDocument> LoadAsync(string path)

Parameters

path string

Returns

Task<ImageDocument>

A task representing the asynchronous load operation, whose result is the loaded ImageDocument. / 代表非同步載入作業的工作,其結果為載入完成的 ImageDocument

LoadAsync(string, CancellationToken)

Short overload of LoadAsync that accepts path and cancellationToken; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 path 與 cancellationToken;其餘可選參數使用預設值並轉呼叫最長 LoadAsync 多載。

public static Task<ImageDocument> LoadAsync(string path, CancellationToken cancellationToken)

Parameters

path string
cancellationToken CancellationToken

Returns

Task<ImageDocument>