Private Sub DrawCSpline
Dim piece As Int
Dim xPos As Int
Dim yPos As Int
Dim lastx As Int = -1
Dim lasty As Int = -1
Dim Can As Canvas
Can.Initialize(PanelMain)
Can.DrawColor(Colors.White)
Can.AntiAlias=True
SetPandU
For piece = 0 To Point.Length - 2
For xPos = Point(piece).x To Point(piece + 1).x
yPos = getCurvePoint(piece, xPos)
If lastx=-1 And lasty=-1 Then Can.DrawCircle(xPos, yPos,1dip,Colors.Red,True,1dip)
Can.DrawLine(lastx,lasty,xPos,yPos,Colors.Red,1dip)
lastx=xPos
lasty=yPos
Next
Next
End Sub