目錄 / Table of Contents

Class OdfShape

Namespace
OdfKit.Presentation
Assembly
OdfKit.dll

Provides the OdfShape API. 提供 OdfShape API。

public class OdfShape
Inheritance
OdfShape
Derived
Inherited Members

Constructors

OdfShape(OdfNode, OdfDocument)

Initializes a new instance of the OdfShape class. 初始化 OdfShape 類別的新執行個體。

public OdfShape(OdfNode node, OdfDocument doc)

Parameters

node OdfNode

The underlying OdfKit.DOM.OdfNode instance. / 底層的 OdfKit.DOM.OdfNode 執行個體。

doc OdfDocument

The owning ODF document instance. / 所屬的 ODF 文件執行個體。

OdfShape(OdfNode, OdfDocument, OdfSlide?)

Represents the base class for shapes within a slide. 表示投影片內圖形的基底類別。

public OdfShape(OdfNode node, OdfDocument doc, OdfSlide? slide)

Parameters

node OdfNode

The underlying OdfKit.DOM.OdfNode instance. / 底層的 OdfKit.DOM.OdfNode 執行個體。

doc OdfDocument

The owning document instance. / 所屬的文件執行個體。

slide OdfSlide

The owning slide instance, or null when the shape does not belong to a presentation slide. / 所屬的投影片執行個體,若不屬於簡報投影片則為 null

OdfShape(OdfNode, OdfSlide)

Initializes a new instance of the OdfShape class. 初始化 OdfShape 類別的新執行個體。

public OdfShape(OdfNode node, OdfSlide slide)

Parameters

node OdfNode

The underlying OdfKit.DOM.OdfNode instance. / 底層的 OdfKit.DOM.OdfNode 執行個體。

slide OdfSlide

The owning slide instance. / 所屬的投影片執行個體。

Properties

ClipPathData

Gets the SVG path data of the shape contour clip. 取得圖形輪廓裁切的 SVG 路徑資料。

public string? ClipPathData { get; }

Property Value

string

ClipRectangle

Gets or sets the rectangular clip expression, such as rect(1cm, 5cm, 4cm, 1cm). 取得或設定矩形裁切運算式,例如 rect(1cm, 5cm, 4cm, 1cm)

public string? ClipRectangle { get; set; }

Property Value

string

Document

Gets the owning ODF document. 取得所屬的 ODF 文件。

public OdfDocument Document { get; }

Property Value

OdfDocument

FillColor

Gets or sets the shape fill color. 取得或設定圖形的填滿色彩。

public string? FillColor { get; set; }

Property Value

string

FillGradientName

Gets or sets the named gradient used to fill this shape. 取得或設定用於填滿此圖形的具名稱漸層。

public string? FillGradientName { get; set; }

Property Value

string

Id

Gets or sets the shape identifier. 取得或設定圖形的識別碼。

public string Id { get; set; }

Property Value

string

IsDecorative

Gets whether this shape is marked as decorative, including LibreOffice loext:decorative compatibility reads. 取得此圖形是否標記為裝飾性(含 LibreOffice loext:decorative 相容讀取)。

public bool IsDecorative { get; }

Property Value

bool

LocalName

Gets the local name of the shape node. 取得圖形節點的區域名稱。

public string LocalName { get; }

Property Value

string

MarkerEndName

Gets or sets the named marker at the end of this shape's line. 取得或設定此圖形線段終點的具名稱標記。

public string? MarkerEndName { get; set; }

Property Value

string

MarkerStartName

Gets or sets the named marker at the start of this shape's line. 取得或設定此圖形線段起點的具名稱標記。

public string? MarkerStartName { get; set; }

Property Value

string

Slide

Gets the owning slide instance. 取得所屬的投影片執行個體。

public OdfSlide? Slide { get; }

Property Value

OdfSlide

StrokeColor

Gets or sets the shape stroke color. 取得或設定圖形的邊框色彩。

public string? StrokeColor { get; set; }

Property Value

string

StrokeStyle

Gets or sets the shape stroke style, such as solid, dash, or none. 取得或設定圖形的邊框線條樣式,例如 soliddashnone

public string? StrokeStyle { get; set; }

Property Value

string

StrokeWidth

Gets or sets the shape stroke width, such as 1.5pt. 取得或設定圖形的邊框寬度,例如 1.5pt

public string? StrokeWidth { get; set; }

Property Value

string

Methods

AddEmbeddedTable(int, int)

Creates an embedded table inside this shape frame. 在此圖形框架內建立嵌入表格。

public OdfEmbeddedTable AddEmbeddedTable(int rows, int columns)

Parameters

rows int

The row count. / 列數。

columns int

The column count. / 欄數。

Returns

OdfEmbeddedTable

The newly created embedded table. / 新建立的嵌入表格。

Animate(OdfAnimationType, OdfLength, OdfLength)

Adds an animation effect to the shape. 為圖形新增動畫效果。

public void Animate(OdfAnimationType type, OdfLength duration, OdfLength delay)

Parameters

type OdfAnimationType

The animation type. / 動畫類型。

duration OdfLength

The animation duration. / 動畫持續時間。

delay OdfLength

The animation startup delay. / 動畫延遲啟動時間。

Exceptions

InvalidOperationException

When the shape does not belong to a slide. / 若圖形不屬於投影片則擲出。

ClearClipPath()

Removes the SVG contour path clip while preserving other shape content. 移除 SVG 輪廓路徑裁切,同時保留其他圖形內容。

public bool ClearClipPath()

Returns

bool

true if removed; otherwise false. / 若已移除則為 true,否則為 false

MarkAsDecorative()

Short overload of MarkAsDecorative that uses default values for all optional parameters and forwards to the full overload. 便利多載:MarkAsDecorative 的所有可選參數使用預設值並轉呼叫最長多載。

public OdfShape MarkAsDecorative()

Returns

OdfShape

MarkAsDecorative(bool)

Marks this shape as decorative so assistive technologies should skip it. 將此圖形標記為裝飾性,輔助技術應略過此物件。

public OdfShape MarkAsDecorative(bool decorative)

Parameters

decorative bool

Whether to mark the shape as decorative. / 是否標記為裝飾性。

Returns

OdfShape

The current shape instance. / 目前圖形執行個體。

SetClipPath(string, string)

Sets an SVG contour path used to clip this shape. 設定用於裁切此圖形的 SVG 輪廓路徑。

public OdfShape SetClipPath(string pathData, string viewBox)

Parameters

pathData string

The SVG path data. / SVG 路徑資料。

viewBox string

The SVG view box. / SVG 檢視方塊。

Returns

OdfShape

The current shape. / 目前圖形。

SetConnectorRoutePoints(IEnumerable<(OdfLength X, OdfLength Y)>)

Sets custom route vertices for a connector line from a coordinate collection. 以座標集合設定連接線的自訂路由頂點。

public OdfShape SetConnectorRoutePoints(IEnumerable<(OdfLength X, OdfLength Y)> points)

Parameters

points IEnumerable<(OdfLength X, OdfLength Y)>

The route vertex coordinate collection. / 路由頂點座標集合。

Returns

OdfShape

The current shape instance. / 目前圖形執行個體。

Exceptions

InvalidOperationException

When the shape is not a connector line. / 當圖形不是連接線時擲出。

SetConnectorRoutePoints(string)

Sets custom route vertices for a connector line (draw:points). 設定連接線的自訂路由頂點(draw:points)。

public OdfShape SetConnectorRoutePoints(string points)

Parameters

points string

The whitespace-separated coordinate-pair string, such as 0cm 0cm 1cm 1cm. / 以空白分隔的座標對字串,例如 0cm 0cm 1cm 1cm

Returns

OdfShape

The current shape instance. / 目前圖形執行個體。

Exceptions

InvalidOperationException

When the shape is not a connector line. / 當圖形不是連接線時擲出。