问题不难,会的请进来看看(30分)

  • 主题发起人 主题发起人 雨幽公主
  • 开始时间 开始时间

雨幽公主

Unregistered / Unconfirmed
GUEST, unregistred user!
画贝塞尔曲线时,怎么让起始点从我指定的点开始画起.
我写了一个画贝塞尔曲线的程序.可以根据已知点求出控制点,比如我的第一个点是(10,20)怎么让程序从这个点画起,而不是从我的image的左上角或左下角开始画。
我用的是image.canvas.polybezier
嫌分少可以再加。
 
先image.canvas.MoveTo(10,20)
 
你的点集怎么加的?把点集手动设置
 
什么点集?不懂啊?怎么设置,老兄说详细点。
 
两个函数连和用就可以image.canvas.MoveTo(10,20)
Image1.Canvas.LineTo(X,Y)
 
看看Help TCanvas.PolyBezier 和TCanvas.PolyBezierTo
Draws a set of B閦ier curves.

procedure PolyBezier(const Points: array ofTPoint);

Description

Use PolyBezier to draw cubic B閦ier curves using the endpoints and control points specified by the Points parameter. The first curve is drawn from the first point to the fourth point, using the second and third points as control points. Each subsequent curve in the sequence needs exactly three more points: the ending point of the previous curve is used as the starting point, the next two points in the sequence are control points, and the third is the ending point.

The Points parameter gives the endpoints to use when generating the B閦ier curves.

This procedure draws lines by using the current pen.

Tip: Use the Slice function to pass a portion of an array of points to the PolyBezier method. For example, to form a B閦ier curve using the first ten points from an array of 100 points, use the Slice function as follows:

Canvas.PolyBezier(Slice(PointArray, 10));

Control points after a[Index+3] are ignored. Nothing happens if there aren't enough control points
 
看不懂啊
 

Similar threads

回复
0
查看
841
不得闲
回复
0
查看
712
不得闲
回复
0
查看
886
不得闲
回复
0
查看
888
不得闲
后退
顶部