GraphicsPath.AddCurve 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
向当前图添加样条曲线。 使用基数样条曲线,因为曲线穿过数组中的每个点。
重载
AddCurve(ReadOnlySpan<Point>, Single) | |
AddCurve(PointF[], Int32, Int32, Single) |
向当前图添加样条曲线。 |
AddCurve(Point[], Int32, Int32, Single) |
向当前图添加样条曲线。 |
AddCurve(ReadOnlySpan<PointF>, Single) | |
AddCurve(PointF[], Single) |
向当前图添加样条曲线。 |
AddCurve(Point[]) |
向当前图添加样条曲线。 使用基数样条曲线,因为曲线穿过数组中的每个点。 |
AddCurve(ReadOnlySpan<PointF>) | |
AddCurve(ReadOnlySpan<Point>) | |
AddCurve(PointF[]) |
向当前图添加样条曲线。 使用基数样条曲线,因为曲线穿过数组中的每个点。 |
AddCurve(Point[], Single) |
向当前图添加样条曲线。 |
AddCurve(ReadOnlySpan<Point>, Single)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
public:
void AddCurve(ReadOnlySpan<System::Drawing::Point> points, float tension);
public void AddCurve (ReadOnlySpan<System.Drawing.Point> points, float tension);
member this.AddCurve : ReadOnlySpan<System.Drawing.Point> * single -> unit
Public Sub AddCurve (points As ReadOnlySpan(Of Point), tension As Single)
参数
- points
- ReadOnlySpan<Point>
- tension
- Single
适用于
AddCurve(PointF[], Int32, Int32, Single)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
向当前图添加样条曲线。
public:
void AddCurve(cli::array <System::Drawing::PointF> ^ points, int offset, int numberOfSegments, float tension);
public void AddCurve (System.Drawing.PointF[] points, int offset, int numberOfSegments, float tension);
member this.AddCurve : System.Drawing.PointF[] * int * int * single -> unit
Public Sub AddCurve (points As PointF(), offset As Integer, numberOfSegments As Integer, tension As Single)
参数
- offset
- Int32
用作曲线第一个点的 points
数组中的元素的索引。
- numberOfSegments
- Int32
用于绘制曲线的段数。 可将线段视为连接两个点的线。
- tension
- Single
一个值,该值指定曲线在控制点之间弯曲的量。 大于 1 的值会产生不可预知的结果。
示例
有关示例,请参阅 AddCurve(Point[], Int32, Int32, Single)。
注解
如果需要,用户必须保留原始点。 原始点在内部转换为立方贝塞尔控制点,因此没有返回原始点的机制。
曲线从由 offset
指定的数组中的点开始,并包括由 numberOfSegments
指定的点数(段)。
适用于
AddCurve(Point[], Int32, Int32, Single)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
向当前图添加样条曲线。
public:
void AddCurve(cli::array <System::Drawing::Point> ^ points, int offset, int numberOfSegments, float tension);
public void AddCurve (System.Drawing.Point[] points, int offset, int numberOfSegments, float tension);
member this.AddCurve : System.Drawing.Point[] * int * int * single -> unit
Public Sub AddCurve (points As Point(), offset As Integer, numberOfSegments As Integer, tension As Single)
参数
- offset
- Int32
用作曲线第一个点的 points
数组中的元素的索引。
- numberOfSegments
- Int32
一个值,该值指定曲线在控制点之间弯曲的量。 大于 1 的值会产生不可预知的结果。
- tension
- Single
一个值,该值指定曲线在控制点之间弯曲的量。 大于 1 的值会产生不可预知的结果。
示例
下面的代码示例旨在与 Windows 窗体一起使用,它需要 PaintEventArgse
OnPaint 事件对象。 该代码执行以下操作:
创建一个由四个点构成的数组(表示基数样条)。
创建路径并使用点数组,将曲线添加到路径。
绘制屏幕的路径。
请注意,虽然数组包含四个点,但只有三个段,这是调用 AddCurve的第三个参数中指定的数字。
private:
void AddCurveExample( PaintEventArgs^ e )
{
// Create some points.
Point point1 = Point(20,20);
Point point2 = Point(40,0);
Point point3 = Point(60,40);
Point point4 = Point(80,20);
// Create an array of the points.
array<Point>^ curvePoints = {point1,point2,point3,point4};
// Create a GraphicsPath object and add a curve.
GraphicsPath^ myPath = gcnew GraphicsPath;
myPath->AddCurve( curvePoints, 0, 3, 0.8f );
// Draw the path to the screen.
Pen^ myPen = gcnew Pen( Color::Black,2.0f );
e->Graphics->DrawPath( myPen, myPath );
}
private void AddCurveExample(PaintEventArgs e)
{
// Create some points.
Point point1 = new Point(20, 20);
Point point2 = new Point(40, 0);
Point point3 = new Point(60, 40);
Point point4 = new Point(80, 20);
// Create an array of the points.
Point[] curvePoints = {point1, point2, point3, point4};
// Create a GraphicsPath object and add a curve.
GraphicsPath myPath = new GraphicsPath();
myPath.AddCurve(curvePoints, 0, 3, 0.8f);
// Draw the path to the screen.
Pen myPen = new Pen(Color.Black, 2);
e.Graphics.DrawPath(myPen, myPath);
}
Public Sub AddCurveExample(ByVal e As PaintEventArgs)
' Create some points.
Dim point1 As New Point(20, 20)
Dim point2 As New Point(40, 0)
Dim point3 As New Point(60, 40)
Dim point4 As New Point(80, 20)
' Create an array of the points.
Dim curvePoints As Point() = {point1, point2, point3, point4}
' Create a GraphicsPath object and add a curve.
Dim myPath As New GraphicsPath
myPath.AddCurve(curvePoints, 0, 3, 0.8F)
' Draw the path to the screen.
Dim myPen As New Pen(Color.Black, 2)
e.Graphics.DrawPath(myPen, myPath)
End Sub
注解
如果需要,用户必须保留原始点。 原始点在内部转换为立方贝塞尔控制点,因此没有返回原始点的机制。
曲线从 offset
参数指定的数组中的点开始,包括由 numberOfSegments
指定的点数(段)。
适用于
AddCurve(ReadOnlySpan<PointF>, Single)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
public:
void AddCurve(ReadOnlySpan<System::Drawing::PointF> points, float tension);
public void AddCurve (ReadOnlySpan<System.Drawing.PointF> points, float tension);
member this.AddCurve : ReadOnlySpan<System.Drawing.PointF> * single -> unit
Public Sub AddCurve (points As ReadOnlySpan(Of PointF), tension As Single)
参数
- points
- ReadOnlySpan<PointF>
- tension
- Single
适用于
AddCurve(PointF[], Single)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
向当前图添加样条曲线。
public:
void AddCurve(cli::array <System::Drawing::PointF> ^ points, float tension);
public void AddCurve (System.Drawing.PointF[] points, float tension);
member this.AddCurve : System.Drawing.PointF[] * single -> unit
Public Sub AddCurve (points As PointF(), tension As Single)
参数
- tension
- Single
一个值,该值指定曲线在控制点之间弯曲的量。 大于 1 的值会产生不可预知的结果。
示例
有关示例,请参阅 AddCurve(Point[], Int32, Int32, Single)。
注解
如果需要,用户必须保留原始点。 原始点在内部转换为立方贝塞尔控制点,因此没有返回原始点的机制。
适用于
AddCurve(Point[])
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
向当前图添加样条曲线。 使用基数样条曲线,因为曲线穿过数组中的每个点。
public:
void AddCurve(cli::array <System::Drawing::Point> ^ points);
public:
void AddCurve(... cli::array <System::Drawing::Point> ^ points);
public void AddCurve (System.Drawing.Point[] points);
public void AddCurve (params System.Drawing.Point[] points);
member this.AddCurve : System.Drawing.Point[] -> unit
Public Sub AddCurve (points As Point())
Public Sub AddCurve (ParamArray points As Point())
参数
示例
有关示例,请参阅 AddClosedCurve(Point[], Single)。
注解
如果需要,用户必须保留原始点。 原始点在内部转换为立方贝塞尔控制点,因此没有返回原始点的机制。
适用于
AddCurve(ReadOnlySpan<PointF>)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
public:
void AddCurve(ReadOnlySpan<System::Drawing::PointF> points);
public void AddCurve (scoped ReadOnlySpan<System.Drawing.PointF> points);
member this.AddCurve : ReadOnlySpan<System.Drawing.PointF> -> unit
Public Sub AddCurve (points As ReadOnlySpan(Of PointF))
参数
- points
- ReadOnlySpan<PointF>
适用于
AddCurve(ReadOnlySpan<Point>)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
public:
void AddCurve(ReadOnlySpan<System::Drawing::Point> points);
public void AddCurve (ReadOnlySpan<System.Drawing.Point> points);
member this.AddCurve : ReadOnlySpan<System.Drawing.Point> -> unit
Public Sub AddCurve (points As ReadOnlySpan(Of Point))
参数
- points
- ReadOnlySpan<Point>
适用于
AddCurve(PointF[])
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
向当前图添加样条曲线。 使用基数样条曲线,因为曲线穿过数组中的每个点。
public:
void AddCurve(cli::array <System::Drawing::PointF> ^ points);
public:
void AddCurve(... cli::array <System::Drawing::PointF> ^ points);
public void AddCurve (System.Drawing.PointF[] points);
public void AddCurve (params System.Drawing.PointF[] points);
member this.AddCurve : System.Drawing.PointF[] -> unit
Public Sub AddCurve (points As PointF())
Public Sub AddCurve (ParamArray points As PointF())
参数
示例
有关示例,请参阅 AddCurve(Point[], Int32, Int32, Single)。
注解
如果需要,用户必须保留原始点。 原始点在内部转换为立方贝塞尔控制点,因此没有返回原始点的机制。
适用于
AddCurve(Point[], Single)
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
- Source:
- GraphicsPath.cs
向当前图添加样条曲线。
public:
void AddCurve(cli::array <System::Drawing::Point> ^ points, float tension);
public void AddCurve (System.Drawing.Point[] points, float tension);
member this.AddCurve : System.Drawing.Point[] * single -> unit
Public Sub AddCurve (points As Point(), tension As Single)
参数
- tension
- Single
一个值,该值指定曲线在控制点之间弯曲的量。 大于 1 的值会产生不可预知的结果。
示例
有关示例,请参阅 AddClosedCurve(Point[], Single)。
注解
如果需要,用户必须保留原始点。 原始点在内部转换为立方贝塞尔控制点,因此没有返回原始点的机制。