Class OdfTextImageCollection
Adds images to text documents. 提供圖片新增入口。
public sealed class OdfTextImageCollection : IEnumerable<OdfImage>, IEnumerable
- Inheritance
-
OdfTextImageCollection
- Implements
- Inherited Members
Constructors
OdfTextImageCollection(TextDocument)
Initializes a new instance of the OdfTextImageCollection class. 初始化 OdfTextImageCollection 類別的新執行個體。
public OdfTextImageCollection(TextDocument document)
Parameters
documentTextDocumentThe owning text document. / 所屬文字文件。
Properties
Items
Gets the list of images in the document body. 取得文件本文中的圖片清單。
public IReadOnlyList<OdfImage> Items { get; }
Property Value
Methods
Add(byte[], OdfLength, OdfLength)
Short overload of Add that accepts imageBytes, width, and height; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 imageBytes、width 與 height;其餘可選參數使用預設值並轉呼叫最長 Add 多載。
public OdfImage Add(byte[] imageBytes, OdfLength width, OdfLength height)
Parameters
Returns
Add(byte[], OdfLength, OdfLength, string?)
Adds an image to a new paragraph. 新增圖片至新的段落。
public OdfImage Add(byte[] imageBytes, OdfLength width, OdfLength height, string? name)
Parameters
imageBytesbyte[]The binary image content. / 圖片二進位內容。
widthOdfLengthThe image width. / 圖片寬度。
heightOdfLengthThe image height. / 圖片高度。
namestringThe optional image name. / 選用的圖片名稱。
Returns
- OdfImage
The newly added image. / 新增完成的圖片。
GetEnumerator()
Gets an enumerator over the images, for use with LINQ queries. 取得圖片列舉器,供 LINQ 查詢使用。
public IEnumerator<OdfImage> GetEnumerator()
Returns
- IEnumerator<OdfImage>
The image enumerator. / 圖片列舉器。