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)
public OdfShape(OdfNode node, OdfDocument doc)
Parameters
nodeOdfNodeThe underlying OdfKit.DOM.OdfNode instance. / 底層的 OdfKit.DOM.OdfNode 執行個體。
docOdfDocumentThe 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
nodeOdfNodeThe underlying OdfKit.DOM.OdfNode instance. / 底層的 OdfKit.DOM.OdfNode 執行個體。
docOdfDocumentThe owning document instance. / 所屬的文件執行個體。
slideOdfSlideThe owning slide instance, or
nullwhen the shape does not belong to a presentation slide. / 所屬的投影片執行個體,若不屬於簡報投影片則為null。
OdfShape(OdfNode, OdfSlide)
public OdfShape(OdfNode node, OdfSlide slide)
Parameters
nodeOdfNodeThe underlying OdfKit.DOM.OdfNode instance. / 底層的 OdfKit.DOM.OdfNode 執行個體。
slideOdfSlideThe owning slide instance. / 所屬的投影片執行個體。
Properties
Document
Gets the owning ODF document. 取得所屬的 ODF 文件。
public OdfDocument Document { get; }
Property Value
FillColor
Gets or sets the shape fill color. 取得或設定圖形的填滿色彩。
public string? FillColor { get; set; }
Property Value
Id
Gets or sets the shape identifier. 取得或設定圖形的識別碼。
public string Id { get; set; }
Property Value
IsDecorative
Gets whether this shape is marked as decorative, including LibreOffice loext:decorative compatibility reads.
取得此圖形是否標記為裝飾性(含 LibreOffice loext:decorative 相容讀取)。
public bool IsDecorative { get; }
Property Value
LocalName
Gets the local name of the shape node. 取得圖形節點的區域名稱。
public string LocalName { get; }
Property Value
Slide
Gets the owning slide instance. 取得所屬的投影片執行個體。
public OdfSlide? Slide { get; }
Property Value
StrokeColor
Gets or sets the shape stroke color. 取得或設定圖形的邊框色彩。
public string? StrokeColor { get; set; }
Property Value
StrokeStyle
Gets or sets the shape stroke style, such as solid, dash, or none.
取得或設定圖形的邊框線條樣式,例如 solid、dash 或 none。
public string? StrokeStyle { get; set; }
Property Value
StrokeWidth
Gets or sets the shape stroke width, such as 1.5pt.
取得或設定圖形的邊框寬度,例如 1.5pt。
public string? StrokeWidth { get; set; }
Property Value
Methods
AddEmbeddedTable(int, int)
Creates an embedded table inside this shape frame. 在此圖形框架內建立嵌入表格。
public OdfEmbeddedTable AddEmbeddedTable(int rows, int columns)
Parameters
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
typeOdfAnimationTypeThe animation type. / 動畫類型。
durationOdfLengthThe animation duration. / 動畫持續時間。
delayOdfLengthThe animation startup delay. / 動畫延遲啟動時間。
Exceptions
- InvalidOperationException
When the shape does not belong to a slide. / 若圖形不屬於投影片則擲出。
MarkAsDecorative()
Short overload of MarkAsDecorative that uses default values for all optional parameters and forwards to the full overload. 便利多載:MarkAsDecorative 的所有可選參數使用預設值並轉呼叫最長多載。
public OdfShape MarkAsDecorative()
Returns
MarkAsDecorative(bool)
Marks this shape as decorative so assistive technologies should skip it. 將此圖形標記為裝飾性,輔助技術應略過此物件。
public OdfShape MarkAsDecorative(bool decorative)
Parameters
decorativeboolWhether to mark the shape as decorative. / 是否標記為裝飾性。
Returns
- OdfShape
The current shape instance. / 目前圖形執行個體。
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
pointsIEnumerable<(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
pointsstringThe 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. / 當圖形不是連接線時擲出。