GraphicsPath 類別

定義

表示一系列連接的直線和曲線。Represents a series of connected lines and curves. 這個類別無法被繼承。This class cannot be inherited.

public ref class GraphicsPath sealed : MarshalByRefObject, ICloneable, IDisposable
public sealed class GraphicsPath : MarshalByRefObject, ICloneable, IDisposable
type GraphicsPath = class
    inherit MarshalByRefObject
    interface ICloneable
    interface IDisposable
Public NotInheritable Class GraphicsPath
Inherits MarshalByRefObject
Implements ICloneable, IDisposable
繼承
GraphicsPath
實作

備註

應用程式會使用路徑來繪製圖形的外框、填滿圖案的內部,以及建立裁剪區域。Applications use paths to draw outlines of shapes, fill the interiors of shapes, and create clipping regions. 圖形引擎會在全局座標空間的路徑中維護幾何形狀的座標。The graphics engine maintains the coordinates of geometric shapes in a path in world coordinate space.

路徑可能是由任意數目的圖形(子路徑)所組成。A path may be composed of any number of figures (subpaths). 每個圖都是由一連串的連接線和曲線或幾何圖形基本型別所組成。Each figure is either composed of a sequence of connected lines and curves or a geometric shape primitive. 圖的起點是連接的線條和曲線序列中的第一個點。The starting point of a figure is the first point in the sequence of connected lines and curves. 結束點是序列中的最後一個點。The ending point is the last point in the sequence. 幾何形狀基本類型的開始和結束點是由基本規格所定義。The starting and ending points of a geometric shape primitive are defined by the primitive specification.

由一連串連接的線條和曲線組成的圖形(其起點和終點可能一致)是開放式圖形,除非已明確地關閉。A figure that consists of a sequence of connected lines and curves (whose starting and ending points may be coincident) is an open figure, unless it is closed explicitly. 您可以使用CloseFigure方法明確地關閉圖形,這會藉由將線條從結束點連接到起點來關閉目前的圖表。A figure can be closed explicitly, by using the CloseFigure method, which closes the current figure by connecting a line from the ending point to the starting point. 包含幾何形狀基本類型的圖形是封閉的圖形。A figure that consists of a geometric shape primitive is a closed figure.

基於填滿和裁剪的目的(例如,如果使用來FillPath轉譯路徑),所有開啟的圖形都會藉由從圖表的第一個點加入到最後一個點來關閉。For purposes of filling and clipping (for example, if a path is rendered using FillPath), all open figures are closed by adding a line from the figure's first point to its last point.

當建立路徑或關閉圖表時,會隱含地啟動新的圖形。A new figure is implicitly started when a path is created or when a figure is closed. 呼叫StartFigure方法時,會明確建立新的圖形。A new figure is explicitly created when the StartFigure method is called.

當幾何圖形基本類型新增至路徑時,它會加入包含幾何圖形的圖形,並隱含地開始新的圖形。When a geometric shape primitive is added to a path, it adds a figure containing the geometric shape, and also implicitly starts a new figure. 因此,路徑中一律會有最新的圖表。Consequently, there is always a current figure in a path. 將線條和曲線加入至路徑時,會視需要加入隱含線條,將目前圖形的終點連接到新行和曲線的起點,以形成一系列連接的直線和曲線。When lines and curves are added to a path, an implicit line is added as needed to connect the ending point of the current figure to the starting point of the new lines and curves to form a sequence of connected lines and curves.

圖中有一個方向,描述如何在起點和終點之間追蹤線條和曲線線段。A figure has a direction that describes how line and curve segments are traced between the starting point and the ending point. 方向的定義順序為將線條和曲線加入圖形,或由幾何圖形基本型別定義。The direction is defined in the order that lines and curves are added to a figure, or is defined by the geometric shape primitive. 方向用於判斷用於裁剪和填滿的路徑內部。The direction is used in determining the path interiors for clipping and fill.

建構函式

GraphicsPath()

使用 GraphicsPathFillMode 值,初始化 Alternate 類別的新執行個體。Initializes a new instance of the GraphicsPath class with a FillMode value of Alternate.

GraphicsPath(FillMode)

使用指定的 GraphicsPath 列舉型別,初始化 FillMode 類別的新執行個體。Initializes a new instance of the GraphicsPath class with the specified FillMode enumeration.

GraphicsPath(Point[], Byte[])

使用指定的 GraphicsPathPathPointType 陣列,初始化 Point 類別的新執行個體。Initializes a new instance of the GraphicsPath class with the specified PathPointType and Point arrays.

GraphicsPath(Point[], Byte[], FillMode)

使用指定的 GraphicsPathPathPointType 陣列以及指定的 Point 列舉型別項目,初始化 FillMode 類別的新執行個體。Initializes a new instance of the GraphicsPath class with the specified PathPointType and Point arrays and with the specified FillMode enumeration element.

GraphicsPath(PointF[], Byte[])

使用指定的 GraphicsPathPathPointType 陣列,初始化 PointF 陣列的新執行個體。Initializes a new instance of the GraphicsPath array with the specified PathPointType and PointF arrays.

GraphicsPath(PointF[], Byte[], FillMode)

使用指定的 GraphicsPathPathPointType 陣列以及指定的 PointF 列舉型別項目,初始化 FillMode 陣列的新執行個體。Initializes a new instance of the GraphicsPath array with the specified PathPointType and PointF arrays and with the specified FillMode enumeration element.

屬性

FillMode

取得或設定 FillMode 列舉型別,此列舉型別決定如何填滿這個 GraphicsPath 中形狀的內部。Gets or sets a FillMode enumeration that determines how the interiors of shapes in this GraphicsPath are filled.

PathData

取得 PathData,它為這個 GraphicsPath 封裝點 (points) 和型別 (types) 的陣列。Gets a PathData that encapsulates arrays of points (points) and types (types) for this GraphicsPath.

PathPoints

取得路徑中的點。Gets the points in the path.

PathTypes

取得 PathPoints 陣列中對應點的型別。Gets the types of the corresponding points in the PathPoints array.

PointCount

取得 PathPointsPathTypes 陣列中的元素數。Gets the number of elements in the PathPoints or the PathTypes array.

方法

AddArc(Int32, Int32, Int32, Int32, Single, Single)

將橢圓弧形附加到目前的圖形。Appends an elliptical arc to the current figure.

AddArc(Rectangle, Single, Single)

將橢圓弧形附加到目前的圖形。Appends an elliptical arc to the current figure.

AddArc(RectangleF, Single, Single)

將橢圓弧形附加到目前的圖形。Appends an elliptical arc to the current figure.

AddArc(Single, Single, Single, Single, Single, Single)

將橢圓弧形附加到目前的圖形。Appends an elliptical arc to the current figure.

AddBezier(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)

將立方貝茲曲線加入至目前圖形。Adds a cubic Bézier curve to the current figure.

AddBezier(Point, Point, Point, Point)

將立方貝茲曲線加入至目前圖形。Adds a cubic Bézier curve to the current figure.

AddBezier(PointF, PointF, PointF, PointF)

將立方貝茲曲線加入至目前圖形。Adds a cubic Bézier curve to the current figure.

AddBezier(Single, Single, Single, Single, Single, Single, Single, Single)

將立方貝茲曲線加入至目前圖形。Adds a cubic Bézier curve to the current figure.

AddBeziers(Point[])

將連接的三次方貝茲曲線序列加入至目前的圖形。Adds a sequence of connected cubic Bézier curves to the current figure.

AddBeziers(PointF[])

將連接的三次方貝茲曲線序列加入至目前的圖形。Adds a sequence of connected cubic Bézier curves to the current figure.

AddClosedCurve(Point[])

將關閉曲線加入這個路徑。Adds a closed curve to this path. 主要曲線會被使用,因為該曲線會經過陣列中的每一個點。A cardinal spline curve is used because the curve travels through each of the points in the array.

AddClosedCurve(Point[], Single)

將關閉曲線加入這個路徑。Adds a closed curve to this path. 主要曲線會被使用,因為該曲線會經過陣列中的每一個點。A cardinal spline curve is used because the curve travels through each of the points in the array.

AddClosedCurve(PointF[])

將關閉曲線加入這個路徑。Adds a closed curve to this path. 主要曲線會被使用,因為該曲線會經過陣列中的每一個點。A cardinal spline curve is used because the curve travels through each of the points in the array.

AddClosedCurve(PointF[], Single)

將關閉曲線加入這個路徑。Adds a closed curve to this path. 主要曲線會被使用,因為該曲線會經過陣列中的每一個點。A cardinal spline curve is used because the curve travels through each of the points in the array.

AddCurve(Point[])

將曲線加入目前的圖形。Adds a spline curve to the current figure. 主要曲線會被使用,因為該曲線會經過陣列中的每一個點。A cardinal spline curve is used because the curve travels through each of the points in the array.

AddCurve(Point[], Int32, Int32, Single)

將曲線加入目前的圖形。Adds a spline curve to the current figure.

AddCurve(Point[], Single)

將曲線加入目前的圖形。Adds a spline curve to the current figure.

AddCurve(PointF[])

將曲線加入目前的圖形。Adds a spline curve to the current figure. 主要曲線會被使用,因為該曲線會經過陣列中的每一個點。A cardinal spline curve is used because the curve travels through each of the points in the array.

AddCurve(PointF[], Int32, Int32, Single)

將曲線加入目前的圖形。Adds a spline curve to the current figure.

AddCurve(PointF[], Single)

將曲線加入目前的圖形。Adds a spline curve to the current figure.

AddEllipse(Int32, Int32, Int32, Int32)

將橢圓形加入目前的路徑。Adds an ellipse to the current path.

AddEllipse(Rectangle)

將橢圓形加入目前的路徑。Adds an ellipse to the current path.

AddEllipse(RectangleF)

將橢圓形加入目前的路徑。Adds an ellipse to the current path.

AddEllipse(Single, Single, Single, Single)

將橢圓形加入目前的路徑。Adds an ellipse to the current path.

AddLine(Int32, Int32, Int32, Int32)

將直線線段附加到目前的圖形。Appends a line segment to the current figure.

AddLine(Point, Point)

將線段附加至這個 GraphicsPathAppends a line segment to this GraphicsPath.

AddLine(PointF, PointF)

將線段附加至這個 GraphicsPathAppends a line segment to this GraphicsPath.

AddLine(Single, Single, Single, Single)

將線段附加至這個 GraphicsPathAppends a line segment to this GraphicsPath.

AddLines(Point[])

將一系列連接的線段附加至這個 GraphicsPath 的結尾。Appends a series of connected line segments to the end of this GraphicsPath.

AddLines(PointF[])

將一系列連接的線段附加至這個 GraphicsPath 的結尾。Appends a series of connected line segments to the end of this GraphicsPath.

AddPath(GraphicsPath, Boolean)

將指定的 GraphicsPath 附加至這個路徑。Appends the specified GraphicsPath to this path.

AddPie(Int32, Int32, Int32, Int32, Single, Single)

將派形的外框加入這個路徑。Adds the outline of a pie shape to this path.

AddPie(Rectangle, Single, Single)

將派形的外框加入這個路徑。Adds the outline of a pie shape to this path.

AddPie(Single, Single, Single, Single, Single, Single)

將派形的外框加入這個路徑。Adds the outline of a pie shape to this path.

AddPolygon(Point[])

將多邊形加入至這個路徑。Adds a polygon to this path.

AddPolygon(PointF[])

將多邊形加入至這個路徑。Adds a polygon to this path.

AddRectangle(Rectangle)

將矩形加入至這個路徑。Adds a rectangle to this path.

AddRectangle(RectangleF)

將矩形加入至這個路徑。Adds a rectangle to this path.

AddRectangles(Rectangle[])

將一系列的矩形加入至這個路徑。Adds a series of rectangles to this path.

AddRectangles(RectangleF[])

將一系列的矩形加入至這個路徑。Adds a series of rectangles to this path.

AddString(String, FontFamily, Int32, Single, Point, StringFormat)

將文字字串加入這個路徑。Adds a text string to this path.

AddString(String, FontFamily, Int32, Single, PointF, StringFormat)

將文字字串加入這個路徑。Adds a text string to this path.

AddString(String, FontFamily, Int32, Single, Rectangle, StringFormat)

將文字字串加入這個路徑。Adds a text string to this path.

AddString(String, FontFamily, Int32, Single, RectangleF, StringFormat)

將文字字串加入這個路徑。Adds a text string to this path.

ClearMarkers()

從這個路徑清除所有的資料標記。Clears all markers from this path.

Clone()

建立這個路徑的完全相同複本。Creates an exact copy of this path.

CloseAllFigures()

關閉在這個路徑中的所有開放的圖形,並開始新的圖形。Closes all open figures in this path and starts a new figure. 它會藉由連接從其開始點至其結束點的直線來關閉每個開放的圖形。It closes each open figure by connecting a line from its endpoint to its starting point.

CloseFigure()

關閉目前的圖形,並開始新的圖形。Closes the current figure and starts a new figure. 如果目前的圖形含有連接的直線和曲線序列,則該方法會藉由連接從結束點至開始點的直線來關閉迴圈。If the current figure contains a sequence of connected lines and curves, the method closes the loop by connecting a line from the endpoint to the starting point.

CreateObjRef(Type)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(繼承來源 MarshalByRefObject)
Dispose()

釋放這個 GraphicsPath 所使用的所有資源。Releases all resources used by this GraphicsPath.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
Finalize()

允許物件在記憶體回收進行回收之前,嘗試釋放資源並執行其他清除作業。Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.

Flatten()

將這個路徑中的每條曲線轉型為連接的直線線段序列。Converts each curve in this path into a sequence of connected line segments.

Flatten(Matrix)

套用指定的轉換,然後將這個 GraphicsPath 中的每條曲線轉換為連接的直線線段序列。Applies the specified transform and then converts each curve in this GraphicsPath into a sequence of connected line segments.

Flatten(Matrix, Single)

將這個 GraphicsPath 中的每條曲線轉換為連接的直線線段序列。Converts each curve in this GraphicsPath into a sequence of connected line segments.

GetBounds()

傳回限定這個 GraphicsPath 之界限的矩形。Returns a rectangle that bounds this GraphicsPath.

GetBounds(Matrix)

當這個 GraphicsPath 路徑由指定的 Matrix 轉換時,會傳回限定這個路徑之界限的矩形。Returns a rectangle that bounds this GraphicsPath when this path is transformed by the specified Matrix.

GetBounds(Matrix, Pen)

當目前路徑由指定的 GraphicsPath 轉換,並使用指定的 Matrix 繪製時,會傳回限定這個 Pen 之界限的矩形。Returns a rectangle that bounds this GraphicsPath when the current path is transformed by the specified Matrix and drawn with the specified Pen.

GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetLastPoint()

取得這個 PathPointsGraphicsPath 陣列中的最後一點。Gets the last point in the PathPoints array of this GraphicsPath.

GetLifetimeService()

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(繼承來源 MarshalByRefObject)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
InitializeLifetimeService()

取得存留期服務物件,以控制這個執行個體的存留期原則。Obtains a lifetime service object to control the lifetime policy for this instance.

(繼承來源 MarshalByRefObject)
IsOutlineVisible(Int32, Int32, Pen)

指出當使用指定的 GraphicsPath 繪製時,指定的點是否包含在這個 Pen 的外框內 (下面)。Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen.

IsOutlineVisible(Int32, Int32, Pen, Graphics)

指出當使用指定的 GraphicsPath 和指定的 Pen 繪製時,指定的點是否包含在這個 Graphics 的外框內 (下面)。Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics.

IsOutlineVisible(Point, Pen)

指出當使用指定的 GraphicsPath 繪製時,指定的點是否包含在這個 Pen 的外框內 (下面)。Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen.

IsOutlineVisible(Point, Pen, Graphics)

指出當使用指定的 GraphicsPath 和指定的 Pen 繪製時,指定的點是否包含在這個 Graphics 的外框內 (下面)。Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics.

IsOutlineVisible(PointF, Pen)

指出當使用指定的 GraphicsPath 繪製時,指定的點是否包含在這個 Pen 的外框內 (下面)。Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen.

IsOutlineVisible(PointF, Pen, Graphics)

指出當使用指定的 GraphicsPath 和指定的 Pen 繪製時,指定的點是否包含在這個 Graphics 的外框內 (下面)。Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics.

IsOutlineVisible(Single, Single, Pen)

指出當使用指定的 GraphicsPath 繪製時,指定的點是否包含在這個 Pen 的外框內 (下面)。Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen.

IsOutlineVisible(Single, Single, Pen, Graphics)

指出當使用指定的 GraphicsPath 和指定的 Pen 繪製時,指定的點是否包含在這個 Graphics 的外框內 (下面)。Indicates whether the specified point is contained within (under) the outline of this GraphicsPath when drawn with the specified Pen and using the specified Graphics.

IsVisible(Int32, Int32)

指出指定的點是否包含在這個 GraphicsPath 內。Indicates whether the specified point is contained within this GraphicsPath.

IsVisible(Int32, Int32, Graphics)

使用指定的 GraphicsPath,指示這個 Graphics 內是否包含指定的點。Indicates whether the specified point is contained within this GraphicsPath, using the specified Graphics.

IsVisible(Point)

指出指定的點是否包含在這個 GraphicsPath 內。Indicates whether the specified point is contained within this GraphicsPath.

IsVisible(Point, Graphics)

指出指定的點是否包含在這個 GraphicsPath 內。Indicates whether the specified point is contained within this GraphicsPath.

IsVisible(PointF)

指出指定的點是否包含在這個 GraphicsPath 內。Indicates whether the specified point is contained within this GraphicsPath.

IsVisible(PointF, Graphics)

指出指定的點是否包含在這個 GraphicsPath 內。Indicates whether the specified point is contained within this GraphicsPath.

IsVisible(Single, Single)

指出指定的點是否包含在這個 GraphicsPath 內。Indicates whether the specified point is contained within this GraphicsPath.

IsVisible(Single, Single, Graphics)

指示指定的點是否包含在指定 GraphicsPath 之可見裁剪區域中的這個 Graphics 內。Indicates whether the specified point is contained within this GraphicsPath in the visible clip region of the specified Graphics.

MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
MemberwiseClone(Boolean)

建立目前 MarshalByRefObject 物件的淺層複本。Creates a shallow copy of the current MarshalByRefObject object.

(繼承來源 MarshalByRefObject)
Reset()

清除 PathPointsPathTypes 陣列,並將 FillMode 設定為 AlternateEmpties the PathPoints and PathTypes arrays and sets the FillMode to Alternate.

Reverse()

反轉這個 PathPointsGraphicsPath 陣列中點的順序。Reverses the order of points in the PathPoints array of this GraphicsPath.

SetMarkers()

在這個 GraphicsPath 上設定資料標記。Sets a marker on this GraphicsPath.

StartFigure()

不關閉目前的圖形而開始新圖形。Starts a new figure without closing the current figure. 所有後續加入至路徑的點會加入至這個新圖形。All subsequent points added to the path are added to this new figure.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)
Transform(Matrix)

將轉換矩陣套用至這個 GraphicsPathApplies a transform matrix to this GraphicsPath.

Warp(PointF[], RectangleF)

將由矩形和平行四邊形所定義的彎曲轉換套用至這個 GraphicsPathApplies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath.

Warp(PointF[], RectangleF, Matrix)

將由矩形和平行四邊形所定義的彎曲轉換套用至這個 GraphicsPathApplies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath.

Warp(PointF[], RectangleF, Matrix, WarpMode)

將由矩形和平行四邊形所定義的彎曲轉換套用至這個 GraphicsPathApplies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath.

Warp(PointF[], RectangleF, Matrix, WarpMode, Single)

將由矩形和平行四邊形所定義的彎曲轉換套用至這個 GraphicsPathApplies a warp transform, defined by a rectangle and a parallelogram, to this GraphicsPath.

Widen(Pen)

將額外的外框加入至路徑。Adds an additional outline to the path.

Widen(Pen, Matrix)

將額外的外框加入至 GraphicsPathAdds an additional outline to the GraphicsPath.

Widen(Pen, Matrix, Single)

將這個 GraphicsPath 取代為封閉在指定的畫筆繪製這個路徑時所填滿之區域的曲線。Replaces this GraphicsPath with curves that enclose the area that is filled when this path is drawn by the specified pen.

適用於

另請參閱